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

date fixes for some US states #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
50 changes: 40 additions & 10 deletions us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ months:
function: easter(year)
function_modifier: -47
- name: Mardi Gras Day
regions: [us_la]
regions: [us_al, us_la]
Copy link
Author

@erluti erluti Sep 12, 2024

Choose a reason for hiding this comment

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

Mardi Gras Day (only in Baldwin and Mobile Counties) (Personal Leave Day will be granted for all other counties.)

https://admincode.legislature.state.al.us/administrative-code/670-X-12-.01

function: easter(year)
function_modifier: -47
- name: Good Friday # informal in general
Expand All @@ -83,7 +83,7 @@ months:
function_modifier: -2
type: informal
- name: Good Friday # public holiday in the following states
regions: [us_ct, us_de, us_gu, us_hi, us_in, us_ky, us_la, us_nj, us_nc, us_nd, us_pr, us_tn]
regions: [us_ct, us_de, us_gu, us_hi, us_in, us_ky, us_la, us_nj, us_nc, us_nd, us_pa, us_pr, us_tn]
Copy link
Author

@erluti erluti Sep 12, 2024

Choose a reason for hiding this comment

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

function: easter(year)
function_modifier: -2
- name: Easter Sunday
Expand Down Expand Up @@ -157,19 +157,24 @@ months:
regions: [us_tx]
mday: 21
- name: Confederate Memorial Day # Last Monday in April
regions: [us_al, us_ms]
regions: [us_ms]
week: -1
wday: 1
- name: Confederate Memorial Day # 4th Monday in April
regions: [us_al]
week: 4
wday: 1
Comment on lines +163 to +166
Copy link
Author

Choose a reason for hiding this comment

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

- name: Confederate Memorial Day
regions: [us_fl]
mday: 26
observed: to_monday_if_sunday(date)
- name: State Holiday # April 20 or April 26
regions: [us_ga]
function: georgia_state_holiday(year, month)
- name: Arbor Day # fixed
- name: Arbor Day
regions: [us_ne]
mday: 28
week: -1
wday: 5
Comment on lines +174 to +177
Copy link
Author

Choose a reason for hiding this comment

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

5:
- name: Truman Day # fixed
regions: [us_mo]
Expand Down Expand Up @@ -268,6 +273,9 @@ months:
- name: Election Day
regions: [us_de, us_hi, us_in, us_mt, us_nj, us_ny, us_pa, us_ri]
function: election_day(year)
- name: Election Day # even years only
regions: [us_la]
function: even_year_election_day(year)
Comment on lines +276 to +278
Copy link
Author

Choose a reason for hiding this comment

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

General Election Day | Tuesday, after the first Monday in November, every two years

https://www.lpsc.louisiana.gov/DNC_Holidays

- name: Veterans Day
regions: [us]
mday: 11
Expand Down Expand Up @@ -365,6 +373,13 @@ methods:
arguments: year
ruby: |
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1
even_year_election_day:
# Tuesday after the first Monday of November but only even years for General Elections
arguments: year
ruby: |
if year % 2 == 0
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1
end
us_inauguration_day:
# January 20, every fourth year, following Presidential election
arguments: year
Expand All @@ -383,7 +398,7 @@ tests:
name: 'Shrove Tuesday'
- given:
date: ['2017-2-28', '2018-2-13', '2019-3-5']
regions: ["us_la"]
regions: ["us_al", "us_la"]
expect:
name: 'Mardi Gras Day'
- given:
Expand All @@ -394,7 +409,7 @@ tests:

- given:
date: ['2017-4-14', '2018-3-30', '2019-4-19']
regions: ["us_ct","us_de","us_gu","us_hi","us_in","us_ky","us_la","us_nj","us_nc","us_nd","us_pr","us_tn"]
regions: ["us_ct","us_de","us_gu","us_hi","us_in","us_ky","us_la","us_nj","us_nc","us_nd","us_pa","us_pr","us_tn"]
expect:
name: 'Good Friday'
- given:
Expand Down Expand Up @@ -592,10 +607,20 @@ tests:
expect:
holiday: false
- given:
date: ['2017-4-24', '2018-4-30', '2019-4-29']
date: ['2017-4-24']
regions: ["us_al", "us_ms"]
expect:
name: "Confederate Memorial Day"
- given:
date: ['2018-4-23', '2019-4-22']
regions: ["us_al"]
expect:
name: "Confederate Memorial Day"
- given:
date: ['2018-4-30', '2019-4-29']
regions: ["us_ms"]
expect:
name: "Confederate Memorial Day"

- given:
date: ['2015-4-27', '2020-4-27', '2026-4-27']
Expand Down Expand Up @@ -632,7 +657,7 @@ tests:
name: "State Holiday"

- given:
date: ['2017-4-28']
date: ['2017-4-28', '2025-4-25']
regions: ["us_ne"]
expect:
name: "Arbor Day"
Expand Down Expand Up @@ -869,10 +894,15 @@ tests:
expect:
holiday: false
- given:
date: ['2017-11-7', '2018-11-6', '2021-11-2']
date: ['2017-11-7', '2021-11-2']
regions: ["us_de", "us_hi", "us_in", "us_mt", "us_nj", "us_ny", "us_pa", "us_ri"]
expect:
name: "Election Day"
- given:
date: ['2018-11-6', '2028-11-7']
regions: ["us_de", "us_hi", "us_in", "us_la", "us_mt", "us_nj", "us_ny", "us_pa", "us_ri"]
expect:
name: "Election Day"
- given:
date: ['2017-11-10', '2018-11-12', '2019-11-11']
regions: ["us"]
Expand Down