Commit Graph

26 Commits (4385d4b85c84e0b270e4217c7df83096e7803cbd)

Author SHA1 Message Date
Erik Andresen 44e201326f catch all fix for #3283 2024-03-22 21:02:40 +01:00
Erik Andresen b135420a6b alarm, sched: Fix #3281
Fix timer
2024-03-22 20:35:06 +01:00
Rob Pilling 0dd67533ac sched: emit alarmReload, widalarm reload on alarmReload 2024-03-03 19:34:24 +00:00
lauzonhomeschool c483cbc067
lib.js support timezone - toLocalISOString
Test scenario:
E.setTimeZone(-8);
date = new Date("2022-12-05T23:00");
date.toLocalISOString(); // -> "2022-12-05T23:00:00.000-0800"
getActiveAlarms([{on: true, t: 0, dow: 0b1111111, date: "2022-12-05"}], date); //should be marked as active, but isn't
getActiveAlarms([{on: true, t: 0, dow: 0b1111111, date: "2022-12-06"}], date); //should not be marked as active, but it is because it is already "tomorrow" in UTC
2022-12-08 17:48:56 -05:00
Alessandro Cocco a8116f3e49 [Scheduler] Add "delete timer at expiration" option 2022-06-19 16:19:01 +02:00
Alessandro Cocco a1c214a502 [Scheduler] Set default patterns to "strong" 2022-06-03 17:32:09 +02:00
Alessandro Cocco c7f8322e3a [Scheduler] Fix default dow 2022-05-20 18:19:34 +02:00
Alessandro Cocco 531cf4b5f9 [Scheduler] Improve readability of some filters
The common conditions are now in the same order
2022-05-20 18:17:48 +02:00
Alessandro Cocco f22f113687 [Alarms & Timers] Full UI rewrite 2022-05-13 15:25:28 +02:00
Alessandro Cocco 94690a81ee Add new time_utils module and move some functions from sched module to it 2022-05-13 15:25:28 +02:00
Erik Andresen 43d696e90b sched: Fix typo 2022-05-04 23:09:04 +02:00
Erik Andresen 1d22050dc6 sched: add day of week check to getActiveAlarms() 2022-05-04 22:58:45 +02:00
Gordon Williams d04674305e Quick tweaks for recent PR 2022-04-25 14:02:12 +01:00
Gordon Williams d740a2bdf3
Merge branch 'master' into sched-update-settings 2022-04-25 12:00:40 +01:00
Alessandro Cocco 1eab970caa [Scheduler] Add "Default Repeat" to settings 2022-04-24 16:26:30 +02:00
storm64 052c1694d2 [Sched] Correct `decodeTime(t)` rounding
Correct `decodeTime(t)` to return a more likely expected time:
- before: `require("sched").decodeTime(60*60*1000-1)` returns: `{ hrs: 0, mins: 60 }`
- after: `require("sched").decodeTime(60*60*1000-1)` returns: `{ hrs: 1, mins: 0 }`
2022-04-21 23:01:39 +02:00
storm64 662581bff0
[sched] Update lib.js
Correct `decodeTime(t)` to return a more likely expected time:
- before: `require("sched").decodeTime(60*60*1000-1)` returns: `{ hrs: 0, mins: 60 }`
- after: `require("sched").decodeTime(60*60*1000-1)` returns: `{ hrs: 1, mins: 0 }`
2022-04-21 22:05:12 +02:00
Erik Andresen 5e847a56fd sched: fix formatTime reference 2022-04-20 20:26:06 +02:00
Erik Andresen 8c048f321c Refactor some methods to scheduling library 2022-04-20 19:32:23 +02:00
Alessandro Cocco b0a43413c8 [Scheduler] Export new functions
- newDefaultAlarm
- newDefaultTimer
- get/setSettings
2022-04-20 14:35:50 +02:00
storm64 c4b7c798d2 sched: Ensure dow wrap, Sa(6)+1 = Su(0) 2022-04-09 14:46:08 +02:00
storm64 9ab2fcdf31 sched: `getTimeToAlarm` check next dow if t<now
Fix undefined output of `getTimeToAlarm` on an alarm that is already in the past to check for the next dow instead of the actual dow.
>> add +1 to time.getDay() if alarm.t < currentTime
2022-04-08 21:24:24 +02:00
storm64 2c729af68c sched: Fix `getTimeToAlarm` for timers
Only set `last` for alarms to prevent a wrong output of `getTimeToAlarm` for a timer already used at same day.
2022-04-07 19:47:45 +02:00
Gordon Williams 67facc692d fix https://github.com/espruino/BangleApps/issues/1555#issuecomment-1087784581 2022-04-05 10:59:13 +01:00
Gordon Williams 25aafe1ccf more refactoring to try and reduce code duplication 2022-04-04 16:58:17 +01:00
Gordon Williams 5c84ec9e2c Refactored alarm into separate 'sched' library/app 2022-04-04 15:49:45 +01:00