Merge pull request #3736 from randyheydon/calallday
calendar: properly display synced all-day events.master
commit
23f4399ce1
|
|
@ -20,3 +20,4 @@
|
|||
0.17: Load holidays before events so the latter is not overpainted
|
||||
0.18: Minor code improvements
|
||||
0.19: Read events synchronized from Gadgetbridge
|
||||
0.20: Correct start time of all-day events synchronized from Gadgetbridge
|
||||
|
|
|
|||
|
|
@ -62,9 +62,11 @@ const loadEvents = () => {
|
|||
}));
|
||||
// all events synchronized from Gadgetbridge
|
||||
events = events.concat((require("Storage").readJSON("android.calendar.json",1) || []).map(a => {
|
||||
// timestamp is in seconds, Date requires milliseconds
|
||||
const date = new Date(a.timestamp * 1000);
|
||||
return {date: date, msg: a.title, type: "e"};
|
||||
// All-day events always start at 00:00:00 UTC, so we need to "undo" the
|
||||
// timezone offsetting to make sure that the day is correct.
|
||||
const offset = a.allDay ? new Date().getTimezoneOffset() * 60 : 0
|
||||
const date = new Date((a.timestamp+offset) * 1000);
|
||||
return {date: date, msg: a.title, type: a.allDay ? "o" : "e"};
|
||||
}));
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "calendar",
|
||||
"name": "Calendar",
|
||||
"version": "0.19",
|
||||
"version": "0.20",
|
||||
"description": "Monthly calendar, displays holidays uploaded from the web interface and scheduled events.",
|
||||
"icon": "calendar.png",
|
||||
"screenshots": [{"url":"screenshot_calendar.png"}],
|
||||
|
|
|
|||
Loading…
Reference in New Issue