svendiedrichsen / jollyday

Jollyday - A holiday API
Other
190 stars 114 forks source link

Inclusive RelativeToFixed holiday #164

Open ben-manes opened 2 years ago

ben-manes commented 2 years ago

I have the following configuration,

<tns:RelativeToFixed validFrom="1776" descriptionPropertiesKey="INDEPENDENCE">
  <tns:Date month="JULY" day="4"/>
  <tns:When>CLOSEST</tns:When>
  <tns:Weekday>MONDAY</tns:Weekday>
</tns:RelativeToFixed>

In 2021 the 4th was a Sunday so I expected the 5th to be a holiday. This worked as expected. In 2022 the 4th was a Monday so I expected the 4th to be a holiday. Instead, it said the 11th is.

The RelativeToFixedParser has the comment don't test start day. Can this be an option or how should I have configured this?

ben-manes commented 2 years ago

~It seems my rule might need to follow this description (from Google'ing)~

~If the Fourth of July falls on a Sunday, the federal observed holiday is the following Monday, July 5. If the Fourth of July falls on a Saturday, the observed holiday for most (but not all) federal employees is Friday, July 3.~