question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wanasitcommented, Aug 13, 2022

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.

1reaction
wanasitcommented, Aug 7, 2022

Hello. Thanks for reporting.

What happened was the reference date “August 2, 2022 - Tuesday” (enum date 2)

  • The “next Sunday” (enum date 0) is 5 day later
  • But, the “next Saturday” is (date enum 6) is 4+7 day later

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found