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

Support FixedWeekdayRelativeToWeekday #275

Open
XSpielinbox opened this issue Aug 21, 2023 · 2 comments
Open

Support FixedWeekdayRelativeToWeekday #275

XSpielinbox opened this issue Aug 21, 2023 · 2 comments
Labels
status: new Initial state for every issue / pull request type: enhancement A general enhancement

Comments

@XSpielinbox
Copy link
Contributor

XSpielinbox commented Aug 21, 2023

More information

Please add support for above holiday type, as this would make definition for e.g. the Queen's official Birthday in the Cayman Islands (usually the Monday after the second Saturday in June), Bermuda Day (the Friday before the last Monday in May), Emancipation Day (the Thursday before the first Monday in August), Somers Day (the Friday before the first Monday in August) or Mary Prince Day (the Friday before the first Monday in August) in Bermuda way easier.

@XSpielinbox XSpielinbox added the status: new Initial state for every issue / pull request label Aug 21, 2023
@XSpielinbox
Copy link
Contributor Author

When thinking about it, one should actually be able to catch all cases above with FixedWeekdayBetweenFixed, though one has to do quite some calculating for that manually.

It's effectively the same for the T.T. Bank Holiday in Isle of Man: it's the Friday after the first Monday in June, which always has to be the Friday between the 5th and 11th of June.

@derTobsch How much work do you expect it to be to implement FixedWeekdayRelativeToWeekday?

Even though it would maybe not be necessary, I would nevertheless highly appreciate this element, because it would free oneself from the tedious work.

@XSpielinbox
Copy link
Contributor Author

XSpielinbox commented Sep 29, 2023

The more I think about it the calculations aren't that complicated, I was only thinking way to complicated before.
But the implementation of FixedWeekdayRelativeToWeekday should be very simple to realize as well. After all, one just hast to take the existing FixedWeekday and just apply a fixed offset depending on the desired weekday and whether it is before or after the day that it is relative to.

For now I changed the definitions in Bermuda to use FixedWeekdayBetweenFixed (see #342), though this is way less descriptive to what is actually the case, where a FixedWeekdayRelativeToWeekday whould actually help. It in the end is just the same kind of syntactic sugar that FixedWeekday provides, that after all could also always be expressed with FixedWeekdayBetweenFixed.

@derTobsch derTobsch modified the milestone: enh Oct 28, 2024
@derTobsch derTobsch added the type: enhancement A general enhancement label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: new Initial state for every issue / pull request type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants