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

Feature request: Support the “N-th” occurrence of a weekday of the month #198

Closed
ssd3 opened this issue Jul 4, 2023 · 5 comments
Closed
Assignees
Milestone

Comments

@ssd3
Copy link

ssd3 commented Jul 4, 2023

Describe the bug
I need to have the scheduled event for example
At 10 a.m. on the third Monday of every month: 0 10 ? * 2#3

code sample:

startCron("Job 1", {
	what: "Job data 1"
}, "0 10 ? * 2#3", "America/New_York");

Error:
TypeError: CronPattern: configuration entry 5 (2#3) contains illegal characters.

@ssd3 ssd3 added the bug label Jul 4, 2023
@Hexagon
Copy link
Owner

Hexagon commented Jul 4, 2023

It is possible right now, by setting legacyMode to false and supplying both day of month and weekday, such as * * * 1-7 * SUN for first sunday of month, or 15-21 * SUN for third sunday of month. But I'll keep this as a feature request.

@Hexagon
Copy link
Owner

Hexagon commented Jul 4, 2023

Oh, there is a feature request in discussions already.

#190

@Hexagon Hexagon closed this as completed Jul 4, 2023
@Hexagon Hexagon reopened this Aug 8, 2023
@Hexagon
Copy link
Owner

Hexagon commented Aug 8, 2023

Re-opening as this is work in progress

@Hexagon Hexagon changed the title Support the “N-th” occurrence of a weekday of the month Feature request: Support the “N-th” occurrence of a weekday of the month Aug 8, 2023
@Hexagon Hexagon self-assigned this Aug 8, 2023
@Hexagon Hexagon added feature and removed bug labels Aug 8, 2023
@Hexagon Hexagon added this to the 7.0.0 milestone Aug 8, 2023
@Hexagon
Copy link
Owner

Hexagon commented Aug 8, 2023

This feature is now pre-released in 7.0.0-dev.1

Install using npm i croner@dev

Updated docs available at dev/docs/usage/pattern.md

@Hexagon
Copy link
Owner

Hexagon commented Aug 13, 2023

Released in 7.0.0

@Hexagon Hexagon closed this as completed Aug 13, 2023
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