commit
29e3516fa2
|
|
@ -4,3 +4,4 @@
|
|||
0.04: Fix `getTimeToAlarm` to check for next dow if alarm.t lower currentTime.
|
||||
0.05: Export new functions (`newDefaultAlarm/Timer`), add Settings page
|
||||
0.06: Refactor some methods to library
|
||||
0.07: Correct `decodeTime(t)` to return a more likely expected time
|
||||
|
|
|
|||
|
|
@ -110,9 +110,9 @@ exports.setSettings = function(settings) {
|
|||
|
||||
// time in ms -> { hrs, mins }
|
||||
exports.decodeTime = function(t) {
|
||||
t = 0 | t; // sanitise
|
||||
let hrs = 0 | (t / 3600000);
|
||||
return { hrs: hrs, mins: Math.round((t - hrs * 3600000) / 60000) };
|
||||
t = Math.ceil(t / 60000); // sanitise to full minutes
|
||||
let hrs = 0 | (t / 60);
|
||||
return { hrs: hrs, mins: t - hrs * 60 };
|
||||
}
|
||||
|
||||
// time in { hrs, mins } -> ms
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "sched",
|
||||
"name": "Scheduler",
|
||||
"version": "0.06",
|
||||
"version": "0.07",
|
||||
"description": "Scheduling library for alarms and timers",
|
||||
"icon": "app.png",
|
||||
"type": "scheduler",
|
||||
|
|
|
|||
Loading…
Reference in New Issue