Thanks. I am tweaking alarm.app.js to have dated events, and I had a similar problem (which occurs depending on the time of the day + if you are in a negative or positive time zone) when I had to save the alarm date. I didn't notice we had access to toLocalIsoString, so at first I used the following instead (which we could use in the scheduler if we prefer to stay backward compatible):
new Date(date - (date.getTimezoneOffset() * 60000)).toISOString().slice(0,10)
As you proposed, I'll document a failing example in the scheduler before proposing an official fix.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks. I am tweaking alarm.app.js to have dated events, and I had a similar problem (which occurs depending on the time of the day + if you are in a negative or positive time zone) when I had to save the alarm date. I didn't notice we had access to toLocalIsoString, so at first I used the following instead (which we could use in the scheduler if we prefer to stay backward compatible):
new Date(date - (date.getTimezoneOffset() * 60000)).toISOString().slice(0,10)
As you proposed, I'll document a failing example in the scheduler before proposing an official fix.