aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroto Takahashi2014-05-07 13:03:33 +0900
committerHiroto Takahashi2014-05-07 13:03:33 +0900
commit0c00790b53cefe9103c96eaca921ebd68c668f79 (patch)
treef774a2abedeedbf2106aac5ffe4bf4329f1b417f
parenteb20651ddfea323e9138a80b9cdf536022791bdf (diff)
downloadvimperator-plugins-0c00790b53cefe9103c96eaca921ebd68c668f79.tar.bz2
update alert.js change hour format
-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;