Merge pull request #3797 from randyheydon/agenda_clkinfo_allday
agenda: fix all-day event offsets in clock info.master
commit
42a81ef4ef
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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"}],
|
||||
|
|
|
|||
Loading…
Reference in New Issue