Merge pull request #3797 from randyheydon/agenda_clkinfo_allday

agenda: fix all-day event offsets in clock info.
master
Rob Pilling 2025-04-11 09:00:05 +01:00 committed by GitHub
commit 42a81ef4ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -17,3 +17,4 @@
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
0.18: Correct date in clockinfo for all-day events in negative timezones

View File

@ -65,7 +65,11 @@
agenda.forEach((entry, i) => {
var title = entry.title.slice(0,12);
var date = new Date(entry.timestamp*1000);
// All day events are always in UTC and always start at 00:00:00, so we
// need to "undo" the timezone offsetting to make sure that the day is
// correct.
var offset = entry.allDay ? new Date().getTimezoneOffset() * 60 : 0
var date = new Date((entry.timestamp+offset)*1000);
var dateStr = locale.date(date).replace(/\d\d\d\d/,"");
var shortStr = ((date-now) > 86400000 || entry.allDay) ? dateStr : locale.time(date,1);
var color = "#"+(0x1000000+Number(entry.color)).toString(16).padStart(6,"0");

View File

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