-
Notifications
You must be signed in to change notification settings - Fork 342
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
inconsistent behaviour #464
Comments
FWIW, the following let referenceDate = new Date('08-02-2022'),
parsingOptions = {
forwardDate: true
},
schedules = [
['next_morning', chrono.parse('Tomorrow, 10:00', referenceDate, parsingOptions)[0].start.date()],
['next_evening', chrono.parse('Tomorrow, 19:00', referenceDate, parsingOptions)[0].start.date()],
['next_saturday', chrono.parse('Saturday, 10:00', referenceDate, parsingOptions)[0].start.date()],
['next_sunday', chrono.parse('Sunday, 15:00', referenceDate, parsingOptions)[0].start.date()]
]; |
Hello. Thanks for reporting. What happened was the reference date "August 2, 2022 - Tuesday" (enum date 2)
Calculating "next" based on the date-enum-offset rather than date-window seems like a bug. However, deciding e.g. what is "Saturday" vs "Next Saturday" has been a difficult edge case, I need some more time to check if it doesn't break any current tests. |
The d0551cd fixes this issue, but there are other changes relating to the day of the week I want to clean up. It should be released in the new minor version (2.4.0) sometime next week. |
@wanasit Thanks a lot for taking the time mate 🙇 |
Published. Please update to |
yields
next_sunday
works as expected whilenext_saturday
is one week off. Am I missing something?The text was updated successfully, but these errors were encountered: