-
• #2
You can set a date on which to fire as well as the time? https://github.com/espruino/BangleApps/blob/master/apps/sched/README.md#internals--library
So as far as I can see, really the only issue is rather than specifying a full timestamp when you schedule the alarm, you have to specify a date and then the time offset on that date - but it seems that's pretty easily to do without having to change the way the library works?
Or is it just that the examples on that page only show the use of:
require("sched").setAlarm("mytimer", { msg : "Wake up", timer : 10 * 60 * 1000 // 10 minutes });
and not:
require("sched").setAlarm("mytimer", { msg : "Wake up", t : 9 * 3600000 // 9 o'clock (in ms) });
and:
require("sched").setAlarm("mytimer", { msg : "Wake up", date : "2022-04-04", t : 9 * 3600000 // 9 o'clock (in ms) });
-
• #3
I had no idea adding a date was a possibility. Not sure how I missed it, may have been the visual offset from "msg" that put it in the day of week section in my head. Possibly also carryover expectations from when I last looked the alarm app.
I have to dig into it but it should cover my use cases.
The only concern would be whether applications that don't handle dates may be confused.
-
• #4
Ok, great! I'll update the README now to make it clearer
The only concern would be whether applications that don't handle dates may be confused.
Hopefully not, because if they use the library functions to find out how long until the alarm runs, they should be ok.
But if you find one that breaks, we need to fix it :)
As it stands the scheduling library is highly alarm focused.
Would it make sense to extend it to encompass the scheduling of events with absolute timestamps?
Potential benefits: