string match

master
cheetah 2 years ago
parent 39c4669912
commit bb9f4b26c2

@ -25,8 +25,8 @@ async function minuteCheck() {
.minutes(+alarm.alarmTime.split(':') [ 1 ]) .minutes(+alarm.alarmTime.split(':') [ 1 ])
let secDiff = alarmTime.diff(timeRN, 'seconds') let secDiff = alarmTime.diff(timeRN, 'seconds')
// //
console.log(alarmTime.format('HH:mm'), secDiff) console.log(alarmTime.format("HH:mm"), secDiff)
if (secDiff > -5 && secDiff < 65) { if (alarmTime.format("HH:mm") == timeRN.format("HH:mm")) {
console.log("TRIGGER", alarm.alarmSchedulingMode) console.log("TRIGGER", alarm.alarmSchedulingMode)
let alarmTrigger = false let alarmTrigger = false
switch (alarm.alarmSchedulingMode) { switch (alarm.alarmSchedulingMode) {

Loading…
Cancel
Save