diff --git a/apps/sched/ChangeLog b/apps/sched/ChangeLog index 711326200..6d9d5caee 100644 --- a/apps/sched/ChangeLog +++ b/apps/sched/ChangeLog @@ -16,3 +16,4 @@ 0.13: Ask to delete a timer after stopping it 0.14: Added clkinfo for alarms and timers 0.15: Automatic translation of some string in clkinfo +0.16: Improve support for date timezone diff --git a/apps/sched/boot.js b/apps/sched/boot.js index 98bb0ff7d..c1bb1fc66 100644 --- a/apps/sched/boot.js +++ b/apps/sched/boot.js @@ -13,7 +13,7 @@ && (a.last != d) // not already fired today && (a.t + 60000 > currentTime) // is not in the past by >1 minute && (a.dow >> time.getDay() & 1) // is allowed on this day of the week - && (!a.date || a.date == time.toISOString().substr(0, 10)) // is allowed on this date + && (!a.date || a.date == time.toLocalISOString().substr(0, 10)) // is allowed on this date ); if (active.length) { active = active.sort((a,b)=>a.t-b.t); // sort by time diff --git a/apps/sched/lib.js b/apps/sched/lib.js index 74018dcde..c8961b9e3 100644 --- a/apps/sched/lib.js +++ b/apps/sched/lib.js @@ -21,7 +21,7 @@ exports.getActiveAlarms = function (alarms, time) { && (a.last != time.getDate()) // not already fired today && (a.t < currentTime) && (a.dow >> time.getDay() & 1) // is allowed on this day of the week - && (!a.date || a.date == time.toISOString().substr(0, 10)) // is allowed on this date + && (!a.date || a.date == time.toLocalISOString().substr(0, 10)) // is allowed on this date ) .sort((a, b) => a.t - b.t); } @@ -46,7 +46,7 @@ exports.getTimeToAlarm = function(alarm, time) { if (!alarm) return undefined; if (!time) time = new Date(); var currentTime = (time.getHours()*3600000)+(time.getMinutes()*60000)+(time.getSeconds()*1000); - var active = alarm.on && (alarm.dow>>((time.getDay()+(alarm.t>((time.getDay()+(alarm.t