mirror of https://github.com/espruino/BangleApps
widalarmeta: use sched lib and remove template comment
parent
4c0eccaf67
commit
a25ed8f6ff
|
@ -19,7 +19,10 @@
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
function getNextAlarm(date) {
|
function getNextAlarm(date) {
|
||||||
const alarms = (require("Storage").readJSON("sched.json",1) || []).filter(alarm => alarm.on && alarm.hidden !== true);
|
const alarms = require("sched")
|
||||||
|
.getAlarms()
|
||||||
|
.filter(alarm => alarm.on && alarm.hidden !== true);
|
||||||
|
|
||||||
WIDGETS["widalarmeta"].numActiveAlarms = alarms.length;
|
WIDGETS["widalarmeta"].numActiveAlarms = alarms.length;
|
||||||
if (alarms.length > 0) {
|
if (alarms.length > 0) {
|
||||||
const times = alarms.map(alarm => require("sched").getTimeToAlarm(alarm, date) || Number.POSITIVE_INFINITY);
|
const times = alarms.map(alarm => require("sched").getTimeToAlarm(alarm, date) || Number.POSITIVE_INFINITY);
|
||||||
|
@ -116,7 +119,6 @@
|
||||||
} /* draw */
|
} /* draw */
|
||||||
|
|
||||||
if (config.maxhours > 0) {
|
if (config.maxhours > 0) {
|
||||||
// add your widget
|
|
||||||
WIDGETS["widalarmeta"]={
|
WIDGETS["widalarmeta"]={
|
||||||
area:"tl",
|
area:"tl",
|
||||||
width: 0, // hide by default = assume no timer
|
width: 0, // hide by default = assume no timer
|
||||||
|
|
Loading…
Reference in New Issue