Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more options to the timespan selector #123

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,28 @@ export default {
return [start, end];
},
},
{
text: this.$t("Yesterday"),
onClick() {
const end = new Date();
end.setDate(end.getDate() - 1);
end.setHours(23, 59, 59, 0);
const start = new Date(end);
start.setHours(0, 0, 0, 0);
return [start, end];
},
},
{
text: this.$t("3 days"),
onClick() {
const end = new Date();
end.setHours(23, 59, 59, 0);
const start = new Date();
start.setDate(end.getDate() - 3);
start.setHours(0, 0, 0, 0);
return [start, end];
},
},
{
text: this.$t("7 days"),
onClick() {
Expand All @@ -214,6 +236,17 @@ export default {
return [start, end];
},
},
{
text: this.$t("15 days"),
onClick() {
const end = new Date();
end.setHours(23, 59, 59, 0);
const start = new Date();
start.setDate(end.getDate() - 15);
start.setHours(0, 0, 0, 0);
return [start, end];
},
},
{
text: this.$t("30 days"),
onClick() {
Expand All @@ -225,6 +258,39 @@ export default {
return [start, end];
},
},
{
text: this.$t("3 months"),
onClick() {
const end = new Date();
end.setHours(23, 59, 59, 0);
const start = new Date();
start.setMonth(end.getMonth() - 3);
start.setHours(0, 0, 0, 0);
return [start, end];
},
},
{
text: this.$t("6 months"),
onClick() {
const end = new Date();
end.setHours(23, 59, 59, 0);
const start = new Date();
start.setMonth(end.getMonth() - 6);
start.setHours(0, 0, 0, 0);
return [start, end];
},
},
{
text: this.$t("1 year"),
onClick() {
const end = new Date();
end.setHours(23, 59, 59, 0);
const start = new Date();
start.setFullYear(end.getFullYear() - 1);
start.setHours(0, 0, 0, 0);
return [start, end];
},
},
],
showTimeRangePanel: false,
};
Expand Down
11 changes: 10 additions & 1 deletion src/locales/cs-CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Baterie",
"Speed": "Rychlost",
"Regions:": "Oblasti:",
"WiFi": "WiFi"
"WiFi": "WiFi",
"Today": "Dnes",
"Yesterday": "Včera",
"3 days": "3 dny",
"7 days": "7 dní",
"15 days": "15 dní",
"30 days": "30 dní",
"3 months": "3 měsíce",
"6 months": "6 měsíců",
"1 year": "1 rok"
}
11 changes: 10 additions & 1 deletion src/locales/da-DK.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Batteri",
"Speed": "Hastighed",
"Regions:": "Regioner:",
"WiFi": "WiFi"
"WiFi": "WiFi",
"Today": "I dag",
"Yesterday": "I går",
"3 days": "3 dage",
"7 days": "7 dage",
"15 days": "15 dage",
"30 days": "30 dage",
"3 months": "3 måneder",
"6 months": "6 måneder",
"1 year": "1 år"
}
11 changes: 10 additions & 1 deletion src/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Akku",
"Speed": "Geschwindigkeit",
"Regions:": "Regionen:",
"WiFi": "WLAN"
"WiFi": "WLAN",
"Today": "Heute",
"Yesterday": "Gestern",
"3 days": "3 Tage",
"7 days": "7 Tage",
"15 days": "15 Tage",
"30 days": "30 Tage",
"3 months": "3 Monate",
"6 months": "6 Monate",
"1 year": "1 Jahr"
}
8 changes: 7 additions & 1 deletion src/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"Select date": "Select date",
"Select time": "Select time",
"Today": "Today",
"Yesterday": "Yesterday",
"3 days": "3 days",
"7 days": "7 days",
"30 days": "30 days"
"15 days": "15 days",
"30 days": "30 days",
"3 months": "3 months",
"6 months": "6 months",
"1 year": "1 year"
}
8 changes: 7 additions & 1 deletion src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
"Select date": "Select date",
"Select time": "Select time",
"Today": "Today",
"Yesterday": "Yesterday",
"3 days": "3 days",
"7 days": "7 days",
"30 days": "30 days"
"15 days": "15 days",
"30 days": "30 days",
"3 months": "3 months",
"6 months": "6 months",
"1 year": "1 year"
}
11 changes: 10 additions & 1 deletion src/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Bateria",
"Speed": "Velocidad",
"Regions:": "Regiones:",
"WiFi": "WiFi"
"WiFi": "WiFi",
"Today": "Hoy",
"Yesterday": "Ayer",
"3 days": "3 días",
"7 days": "7 días",
"15 days": "15 días",
"30 days": "30 días",
"3 months": "3 meses",
"6 months": "6 meses",
"1 year": "1 año"
}
11 changes: 10 additions & 1 deletion src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Batterie",
"Speed": "Vitesse",
"Regions:": "Régions:",
"WiFi": "WiFi"
"WiFi": "WiFi",
"Today": "Aujourd'hui",
"Yesterday": "Hier",
"3 days": "3 jours",
"7 days": "7 jours",
"15 days": "15 jours",
"30 days": "30 jours",
"3 months": "3 mois",
"6 months": "6 mois",
"1 year": "1 an"
}
11 changes: 10 additions & 1 deletion src/locales/sk-SK.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Batéria",
"Speed": "Rýchlosť",
"Regions:": "Oblasti:",
"WiFi": "WiFi"
"WiFi": "WiFi",
"Today": "Dnes",
"Yesterday": "Včera",
"3 days": "3 dni",
"7 days": "7 dní",
"15 days": "15 dní",
"30 days": "30 dní",
"3 months": "3 mesiace",
"6 months": "6 mesiacov",
"1 year": "1 rok"
}
11 changes: 10 additions & 1 deletion src/locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,14 @@
"Battery": "Batarya",
"Speed": "Hız",
"Regions:": "Bölgeler:",
"WiFi": "WiFi"
"WiFi": "WiFi",
"Today": "Bugün",
"Yesterday": "Dün",
"3 days": "3 gün",
"7 days": "7 gün",
"15 days": "15 gün",
"30 days": "30 gün",
"3 months": "3 ay",
"6 months": "6 ay",
"1 year": "1 yıl"
}