1
0
Fork 0

Merge pull request #2554 from nxdefiant/widalarmeta

widalarmeta: fix #2542
master
Gordon Williams 2023-02-03 08:45:31 +00:00 committed by GitHub
commit 5fa45d5d4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -4,3 +4,4 @@
Add option to show seconds Add option to show seconds
0.03: Fix Bell not appearing on alarms > 24h and redrawing interval 0.03: Fix Bell not appearing on alarms > 24h and redrawing interval
Update to match the default alarm widget, and not show itself when an alarm is hidden. Update to match the default alarm widget, and not show itself when an alarm is hidden.
0.04: Fix check for active alarm

View File

@ -2,7 +2,7 @@
"id": "widalarmeta", "id": "widalarmeta",
"name": "Alarm & Timer ETA", "name": "Alarm & Timer ETA",
"shortName": "Alarm ETA", "shortName": "Alarm ETA",
"version": "0.03", "version": "0.04",
"description": "A widget that displays the time to the next Alarm or Timer in hours and minutes, maximum 24h (configurable).", "description": "A widget that displays the time to the next Alarm or Timer in hours and minutes, maximum 24h (configurable).",
"icon": "widget.png", "icon": "widget.png",
"type": "widget", "type": "widget",

View File

@ -9,10 +9,10 @@
function draw() { function draw() {
const times = alarms const times = alarms
.map(alarm => { .map(alarm =>
alarm.hidden !== true alarm.hidden !== true
&& require("sched").getTimeToAlarm(alarm) && require("sched").getTimeToAlarm(alarm)
}) )
.filter(a => a !== undefined); .filter(a => a !== undefined);
const next = times.length > 0 ? Math.min.apply(null, times) : 0; const next = times.length > 0 ? Math.min.apply(null, times) : 0;
let calcWidth = 0; let calcWidth = 0;