Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ months:
observed: to_weekday_if_weekend(date)
year_ranges:
from: 2021
- name: Juneteenth National Independence Day # Juneteenth is not a formal holiday in all US states, https://en.wikipedia.org/wiki/Juneteenth
regions: [us_hi]
mday: 19
observed: to_weekday_if_weekend(date)
type: informal
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding informal here will not give you what you want. The us_hi region inherits from us. The national formal Juneteeth will come through no matter what if us you use us when you make the call.

The only way to really fix this is to remove 'juneteeth' from the overall us region and then re-add it to every region/state that formally observes it. Unfortunately there is no cleaner fix to this but that's not really a 'gem' problem...that's a USA problem. Some states treat it as formal, others don't. Politics!

Let me know how you want to proceed. I think that the 'correct' answer here is that the federal holiday takes precedence, so setting informal is really not an option. It's formal at the federal level. But I'm interested in hearing your feedback.

Copy link
Copy Markdown
Contributor

@DagonWat DagonWat Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ppeble by the way, I really wanted to somehow solve this often-faced blocker, that when some sub-group of a country is having special holiday rule - you have to:

  • for this holiday remove country region and instead type in ALL sub-regions BUT one
  • for that one sub-region create another special rule.

I was thinking that we can somehow create a rule:

  • if there are some special rules for a region inside a country-wide holiday, we could put in a special set of rules right inside yaml config
- name: Juneteenth National Independence Day
    regions: [us]
    mday: 19
    observed: to_weekday_if_weekend(date)
    year_ranges:
      from: 2021
    exempt_regions:
      us_hi: 
        type: informal
      us_tx:
        observed: to_weekday_if_sunday(date)

so basically an ability to define a set of rules for children regions.

year_ranges:
from: 2021
- name: Emancipation Day in Texas # fixed
regions: [us_tx]
mday: 19
Expand All @@ -219,7 +226,7 @@ months:
regions: [us]
mday: 4
- name: Independence Day (Holiday)
regions: [us_va]
regions: [us_va, us_hi]
mday: 4
function: to_weekday_if_weekend(date) # Note: Always if Independence Day don't match
- name: Pioneer Day # fixed
Expand Down Expand Up @@ -716,16 +723,22 @@ tests:
expect:
name: "King Kamehameha I Day"
- given:
date: ['2021-06-19']
date: ['2021-06-18', '2022-06-20', '2023-06-19']
regions: ["us"]
options: ["observed"]
expect:
holiday: false
name: "Juneteenth National Independence Day"
- given:
date: ['2021-06-18']
regions: ["us"]
date: ['2021-06-18', '2022-06-20', '2023-06-19']
regions: ["us_hi"]
options: ["observed"]
expect:
name: false
- given:
date: ['2021-06-18', '2022-06-20', '2023-06-19']
regions: ["us_hi"]
options: ["informal"]
expect:
name: "Juneteenth National Independence Day"
- given:
date: ['2017-6-19']
Expand Down Expand Up @@ -769,7 +782,7 @@ tests:
holiday: false
- given:
date: ['2020-7-3', '2021-7-5', '2026-7-3']
regions: ["us_va"]
regions: ["us_va, us_hi"]
Copy link
Copy Markdown
Member

@ppeble ppeble Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a single string. It should instead look like regions: ["us_va", "us_hi"]

expect:
name: "Independence Day (Holiday)"
- given:
Expand Down
Loading