agenda: Fixed "Today" and "Yesterday" wrongly displayed for allDay events on some time zones
parent
0662bb44f5
commit
4287f3a921
|
|
@ -13,3 +13,4 @@
|
||||||
Added dynamic, short and range fields to clkinfo
|
Added dynamic, short and range fields to clkinfo
|
||||||
0.12: Added color field and updating clkinfo periodically (running events)
|
0.12: Added color field and updating clkinfo periodically (running events)
|
||||||
0.13: Show day of the week in date
|
0.13: Show day of the week in date
|
||||||
|
0.14: Fixed "Today" and "Yesterday" wrongly displayed for allDay events on some time zones
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,12 @@ function formatDay(date) {
|
||||||
if (!settings.useToday) {
|
if (!settings.useToday) {
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
const dateformatted = date.toISOString().split('T')[0]; // yyyy-mm-dd
|
const today = new Date(Date.now());
|
||||||
const today = new Date(Date.now()).toISOString().split('T')[0]; // yyyy-mm-dd
|
if (date.getDay() == today.getDay() && date.getMonth() == today.getMonth())
|
||||||
if (dateformatted == today) {
|
|
||||||
return /*LANG*/"Today ";
|
return /*LANG*/"Today ";
|
||||||
} else {
|
else {
|
||||||
const tomorrow = new Date(Date.now() + 86400 * 1000).toISOString().split('T')[0]; // yyyy-mm-dd
|
const tomorrow = new Date(Date.now() + 86400 * 1000);
|
||||||
if (dateformatted == tomorrow) {
|
if (date.getDay() == tomorrow.getDay() && date.getMonth() == tomorrow.getMonth()) {
|
||||||
return /*LANG*/"Tomorrow ";
|
return /*LANG*/"Tomorrow ";
|
||||||
}
|
}
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "agenda",
|
"id": "agenda",
|
||||||
"name": "Agenda",
|
"name": "Agenda",
|
||||||
"version": "0.13",
|
"version": "0.14",
|
||||||
"description": "Simple agenda",
|
"description": "Simple agenda",
|
||||||
"icon": "agenda.png",
|
"icon": "agenda.png",
|
||||||
"screenshots": [{"url":"screenshot_agenda_overview.png"}, {"url":"screenshot_agenda_event1.png"}, {"url":"screenshot_agenda_event2.png"}],
|
"screenshots": [{"url":"screenshot_agenda_overview.png"}, {"url":"screenshot_agenda_event1.png"}, {"url":"screenshot_agenda_event2.png"}],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue