tyrrellsystems / node-red-contrib-simple-weekly-scheduler

A Node-RED Node to allow recuring events to be scheduled over a week
Apache License 2.0
7 stars 7 forks source link

Date comparison #10

Open tomjmul opened 7 years ago

tomjmul commented 7 years ago

Looks like the date comparison might be a bit off. The calendar saves to UTC, which is then converted to local time:

evtStart.setTime(Date.parse(node.events[i].start))

and then that is compared to the current UTC time.

hardillb commented 7 years ago

It's been a while since I looked at this, do you have an example that shows the problem?

hardillb commented 7 years ago

all the comparisons should be being done in UTC time (unless I've missed one somewhere)

hardillb commented 7 years ago

OK, it's triggering at the right time, but it's adding the wrong time (well the time is right, but timezone is wrong) to the msg that it outputs

tomjmul commented 7 years ago

Thanks for the quick fix. I'll test as soon as I get a chance.

hardillb commented 7 years ago

This change is broken, I'll try and fix it again tomorrow