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

nextRuns returning wrong values when using 4th day of the Month #254

Closed
JustSmile52 opened this issue Aug 2, 2024 · 3 comments
Closed

Comments

@JustSmile52
Copy link

Describe the bug
When using Nth day of the month, 4th day is 4th AND 5th day if exist in this month
To Reproduce

to reproduce You can use fiddle lined to guthub https://jsfiddle.net/hexag0n/hoa8kwsb/
Today: 2/08/2024
Input: 0 0 0 * * 6#4

Output: [8/24/2024 12:00:00 AM
8/31/2024 12:00:00 AM
9/28/2024 12:00:00 AM
10/26/2024 12:00:00 AM
11/23/2024 12:00:00 AM
11/30/2024 12:00:00 AM] (returning also 5th day if exists in that month)

Expected:
[8/24/2024 12:00:00 AM
9/28/2024 12:00:00 AM
10/26/2024 12:00:00 AM
11/23/2024 12:00:00 AM
12/28/2024 12:00:00 AM
1/25/2025 12:00:00 AM] (should return only 4th day of month)

job.nextRuns(6, startL);

This behaviour only extist on 4th day of month but on every day of week (4th monday, 4th tuesday etc.)

System:

  • OS: Windows
  • Runtime Chrome, Node.js
  • Version 8.1.0

Additional context
Add any other context about the problem here.

@JustSmile52 JustSmile52 added the bug label Aug 2, 2024
@JustSmile52 JustSmile52 changed the title nesxtRuns returning wrong values when using 4th day of the Month nextRuns returning wrong values when using 4th day of the Month Aug 2, 2024
@Hexagon
Copy link
Owner

Hexagon commented Aug 2, 2024

Nice find 👍 Will have a look if you're not looking at it already?

@Hexagon
Copy link
Owner

Hexagon commented Aug 2, 2024

Caused by an extra character in the constants, causing 4th weekday and 5th weekday to behave exactly the same master...dev#diff-efef280387c5035ce74d6df1aa4d314aacb0d00232c861e7153243e5738a5354R25

Fixed in dev-channel through 8.1.1-dev.0, https://jsfiddle.net/zn2vLtqy/

Will leave this open for testing a day or two before pulling it to the stable channel

@Hexagon
Copy link
Owner

Hexagon commented Aug 3, 2024

Fixed in node-legacy-support channel (7.x) through 7.0.8, and latest channel through 8.1.1

@Hexagon Hexagon closed this as completed in e41ab97 Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants