vsivsi / meteor-job-collection

A persistent and reactive job queue for Meteor, supporting distributed workers that can run anywhere.
https://atmospherejs.com/vsivsi/job-collection
Other
388 stars 68 forks source link

job.after([time]) always saves new Date() #202

Closed satyavh closed 7 years ago

satyavh commented 7 years ago

I'm trying to make a job run somewhere in the future, like this:

job.after(scheduledAt).save()

where scheduledAt is a date object in the future, example: Tue Nov 14 2016 21:55:00 GMT+0100 (CET)

No matter the value, when I check the created job document, the result is that after is set to new Date(). For example, this particular date object was saved in the job document as:

`after: 2016-11-14 21:51:07.6880 +01:00'

Interestingly, it does work correctly when the day is set to minimum tomorrow. I have the feeling the comparison future < now is not working correctly, perhaps not taking timezone into account.

What is going wrong?

satyavh commented 7 years ago

my bad, I was mixing 24hr clock with 12hr clock