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
interval.prev(): loops infinitely in Brazilian locale #100
Comments
@m0nzderr thanks for reporting! Can you provide me some example(s)? Not sure how to reproduce this one. Tried to change the local tz + changed the opts.tz: not getting the infinite loop. Example code: const interval = parser.parseExpression('0 0 * * * *', {
currentDate: '2017-10-16T00:59:59.999',
tz: 'America/Sao_Paulo'
});
console.log(interval.next().toISOString());
console.log(interval.next().toISOString());
console.log(interval.prev().toISOString());
console.log(interval.next().toISOString()); |
@harrisiirak , sorry for taking too long to respond.
In my production code I had to overcome this problem by overriding your methods with a hack that prevents it from getting stuck on the same date:
|
@m0nzderr I think your patch looks good. Could you send a PR? |
@santigimeno got it! |
@m0nzderr any updates? |
Closing this issues as there are no further updates on this. |
In Brazil, when it reaches the value of "2017-10-16T00:59:59.999", the operation
stays at the same date, causing infinite loop.
see issue moment/moment#3132 :
Until the issue is not fixed, I'd suggest to add a simple workaround for it, something like detecting the "no change" situation and forcing the date to change.
The text was updated successfully, but these errors were encountered: