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

First/Last day of the week/month/year #111

Open
Alsan opened this issue Mar 22, 2023 · 3 comments
Open

First/Last day of the week/month/year #111

Alsan opened this issue Mar 22, 2023 · 3 comments
Labels
enhancement New feature or request parser Implementation belongs in mark-when/parser

Comments

@Alsan
Copy link

Alsan commented Mar 22, 2023

How can I recurrent an event for fist/last day of the week/month/year?

@kochrt
Copy link
Member

kochrt commented Apr 4, 2023

That's not currently supported. Good idea though.

@kochrt kochrt added enhancement New feature or request parser Implementation belongs in mark-when/parser labels Apr 4, 2023
@quinn-p-mchugh
Copy link

Second this. Similarly, I don't believe there's a way to add an event that's on "every second Monday of the month", for example.

I would like to track when Mother's Day is on each year, but I don't believe this is possible with the current parser version.

Are you open to pull requests, @kochrt?

@kochrt
Copy link
Member

kochrt commented Apr 13, 2023

I am, you might try starting here https://github.com/mark-when/parser/blob/main/src/dateRange/checkRecurrence.ts

I guess the syntax would be something like (range) every [first|second|third|last] (dayOfWeek) (amount)?

2023-04-07 every first friday x100
2023-04-07 every other friday for 1 year
2023-04-07 every last monday

A good question would be whether the initial date should be shown or included in the recurrence if it doesn't follow its own recurrence - like if it was 2023-04-13 every monday but 2023-04-13 is a Thursday.

It could get a bit complicated if we did annual dates too:

every May 14
every first Monday in September (??)

This is an aside but another thing I want to add is til or until instead of specifying a specific number of times:

2023-04-07 every friday until 2024-01-01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser Implementation belongs in mark-when/parser
Projects
None yet
Development

No branches or pull requests

3 participants