Skip to content

Commit

Permalink
us: add Juneteenth
Browse files Browse the repository at this point in the history
Fixes #69
  • Loading branch information
rickar committed Jun 19, 2021
1 parent acbad24 commit a193afe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions v2/us/us_holidays.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ var (
Func: cal.CalcWeekdayOffset,
}

// Juneteenth represents Juneteenth on June 19th
Juneteenth = &cal.Holiday{
Name: "Juneteenth",
Type: cal.ObservancePublic,
Month: time.June,
Day: 19,
Observed: weekendAlt,
Func: cal.CalcDayOfMonth,
StartYear: 2021,
}

// IndependenceDay represents Independence Day on 4-Jul
IndependenceDay = &cal.Holiday{
Name: "Independence Day",
Expand Down
12 changes: 12 additions & 0 deletions v2/us/us_holidays_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ func TestHolidays(t *testing.T) {
{MemorialDay, 2021, d(2021, 5, 31), d(2021, 5, 31)},
{MemorialDay, 2022, d(2022, 5, 30), d(2022, 5, 30)},

{Juneteenth, 2015, time.Time{}, time.Time{}},
{Juneteenth, 2016, time.Time{}, time.Time{}},
{Juneteenth, 2017, time.Time{}, time.Time{}},
{Juneteenth, 2018, time.Time{}, time.Time{}},
{Juneteenth, 2019, time.Time{}, time.Time{}},
{Juneteenth, 2020, time.Time{}, time.Time{}},
{Juneteenth, 2021, d(2021, 6, 19), d(2021, 6, 18)},
{Juneteenth, 2022, d(2022, 6, 19), d(2022, 6, 20)},
{Juneteenth, 2023, d(2023, 6, 19), d(2023, 6, 19)},
{Juneteenth, 2024, d(2024, 6, 19), d(2024, 6, 19)},
{Juneteenth, 2025, d(2025, 6, 19), d(2025, 6, 19)},

{IndependenceDay, 2015, d(2015, 7, 4), d(2015, 7, 3)},
{IndependenceDay, 2016, d(2016, 7, 4), d(2016, 7, 4)},
{IndependenceDay, 2017, d(2017, 7, 4), d(2017, 7, 4)},
Expand Down

0 comments on commit a193afe

Please sign in to comment.