inconsistent behaviour
See original GitHub issue let schedules = [
['next_morning', chrono.parse('Tomorrow at 10:00', new Date('08-02-2022'))[0].start.date()],
['next_evening', chrono.parse('Tomorrow at 19:00', new Date('08-02-2022'))[0].start.date()],
['next_saturday', chrono.parse('next Saturday at 11:00', new Date('08-02-2022'))[0].start.date()],
['next_sunday', chrono.parse('next Sunday at 15:00', new Date('08-02-2022'))[0].start.date()]
];
yields
[
[ 'next_morning', 2022-08-03T08:00:00.000Z ],
[ 'next_evening', 2022-08-03T17:00:00.000Z ],
[ 'next_saturday', 2022-08-13T09:00:00.000Z ],
[ 'next_sunday', 2022-08-07T13:00:00.000Z ]
]
next_sunday
works as expected while next_saturday
is one week off. Am I missing something?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to deal with inconsistent people? - The Easy Wisdom
Any person who is not consistent in their behaviour and conduct can be called an inconsistent person. Inconsistent people often give you mixed ......
Read more >Inconsistency in Relationships is a Form of Emotional Abuse
If a person is consistently inconsistent, the behavior is likely to be conscious. We're not always going to be in a good mood....
Read more >The Secret to Why Your Behavior Is Inconsistent - Carl Greer
One way to explore the truth underneath your inconsistencies is to quiet your mind through a meditative practice that you enjoy and then...
Read more >How to deal with inconsistent behaviour
Please help me understand this strange behaviour. Nirupama Dwivedi answers: Consistency in behaviour, I would imagine, is one of the first steps ...
Read more >Behavioral Inconsistencies Do Not Imply Inconsistent Strategies
Inconsistencies in observed behavior have been interpreted as conflicting with assumed stable preferences or traits. According to our analysis, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The d0551cd350f00fce11fa7e9fa860e9d93679047d 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.
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.