Merge pull request #3767 from JamesClarke01/AgendaDayFix

agenda: Fixed bug where "Today" and "Tomorrow" labels display in non-current weeks.
master
Rob Pilling 2025-03-06 21:58:40 +00:00 committed by GitHub
commit 5a20b48a4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View File

@ -16,3 +16,4 @@
0.14: Fixed "Today" and "Yesterday" wrongly displayed for allDay events on some time zones
0.15: Minor code improvements
0.16: Correct date for all day events in negative timezones, improve locale display
0.17: Fixed "Today" and "Tomorrow" labels displaying in non-current weeks

View File

@ -44,11 +44,12 @@ function formatDay(date) {
return formattedDate;
}
const today = new Date(Date.now());
if (date.getDay() == today.getDay() && date.getMonth() == today.getMonth())
if (date.getDate() == today.getDate())
return /*LANG*/"Today ";
else {
const tomorrow = new Date(Date.now() + 86400 * 1000);
if (date.getDay() == tomorrow.getDay() && date.getMonth() == tomorrow.getMonth()) {
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
if (date.getDate() == tomorrow.getDate()) {
return /*LANG*/"Tomorrow ";
}
return formattedDate;

View File

@ -1,7 +1,7 @@
{
"id": "agenda",
"name": "Agenda",
"version": "0.16",
"version": "0.17",
"description": "Simple agenda",
"icon": "agenda.png",
"screenshots": [{"url":"screenshot_agenda_overview.png"}, {"url":"screenshot_agenda_event1.png"}, {"url":"screenshot_agenda_event2.png"}],