Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minute Scheduling for Every 59 minutes is giving incorrect future schdules #223

Open
yas1th opened this issue Jan 29, 2018 · 1 comment
Open

Comments

@yas1th
Copy link

yas1th commented Jan 29, 2018

var gt = later.parse.cron('0/50 * 1/1 * ? ');
var local = new Date("2018-1-29 11:45");
var curDate = new Date();
local.setMinutes(local.getMinutes() - local.getTimezoneOffset());
curDate.setMinutes(curDate.getMinutes() - curDate.getTimezoneOffset());
var arrNextMatchingSchedules = later.schedule(gt).next(5, local, new Date(2099, 12, 31));
console.log(arrNextMatchingSchedules);

I am recieving the results as shown below which is not expected.

Mon Jan 29 2018 17:20:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 17:30:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 18:20:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 18:30:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 19:20:00 GMT+0530 (India Standard Time

This is one of the scenarios which i am posting here but i have observed couple of scenarios in case of minutes where it is not as per expectation.
I have gone through later.js code and debugged but since there were no comments i am unable to understand what is happening?

later.minutes function is having range variable for 60 and it returns a schedules array by splitiing the cron expression . suppose if i give 50 minutes it will set 50 minutes to one schedule and other 10 minutes which 60-50 as other one and again it resets it.

please help me to extend this logic for the above mentioned scenario.

@yas1th
Copy link
Author

yas1th commented Apr 10, 2018

I have fixed the above issue by enhancing the later js code . I have added nextMinSchedules function to solve the above posted issue.

yas1th added a commit to yas1th/later that referenced this issue Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant