aboutsummaryrefslogtreecommitdiffstats
path: root/alert.js
diff options
context:
space:
mode:
Diffstat (limited to 'alert.js')
-rw-r--r--alert.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/alert.js b/alert.js
index 6aeabf8..b2e2085 100644
--- a/alert.js
+++ b/alert.js
@@ -350,8 +350,9 @@ let PLUGIN_INFO = xml`
}
function torelativetime(h, m) {
- if (h < 0 || h > 24 || m < 0 || m > 59)
+ if (m > 59)
return false;
+ h %= 24;
var now = new Date();
var d = (h * 60 + parseInt(m)) - (now.getHours() * 60 + now.getMinutes() + now.getSeconds() / 60);
return d >= 0 ? d : d + 60 * 24;