mirror of https://github.com/espruino/BangleApps
[sleepphasealarm] Update to new time_utils module
parent
94690a81ee
commit
ee663ef169
|
@ -6,3 +6,4 @@
|
|||
0.06: Add logging
|
||||
use Layout library and display ETA
|
||||
0.07: Add check for day of week
|
||||
0.08: Update to new time_utils module
|
||||
|
|
|
@ -46,8 +46,8 @@ function calc_ess(acc_magn) {
|
|||
var nextAlarm;
|
||||
active.forEach(alarm => {
|
||||
const now = new Date();
|
||||
const t = require("sched").decodeTime(alarm.t);
|
||||
var dateAlarm = new Date(now.getFullYear(), now.getMonth(), now.getDate(), t.hrs, t.mins);
|
||||
const time = require("time_utils").decodeTime(alarm.t);
|
||||
var dateAlarm = new Date(now.getFullYear(), now.getMonth(), now.getDate(), time.h, time.m);
|
||||
if (dateAlarm < now) { // dateAlarm in the past, add 24h
|
||||
dateAlarm.setTime(dateAlarm.getTime() + (24*60*60*1000));
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "sleepphasealarm",
|
||||
"name": "SleepPhaseAlarm",
|
||||
"shortName": "SleepPhaseAlarm",
|
||||
"version": "0.07",
|
||||
"version": "0.08",
|
||||
"description": "Uses the accelerometer to estimate sleep and wake states with the principle of Estimation of Stationary Sleep-segments (ESS, see https://ubicomp.eti.uni-siegen.de/home/datasets/ichi14/index.html.en). This app will read the next alarm from the alarm application and will wake you up to 30 minutes early at the best guessed time when you are almost already awake.",
|
||||
"icon": "app.png",
|
||||
"tags": "alarm",
|
||||
|
|
Loading…
Reference in New Issue