Skip to content

Commit

Permalink
add November 20th to brazilian holidays
Browse files Browse the repository at this point in the history
  • Loading branch information
felipenoris committed Mar 12, 2024
1 parent 553545c commit eafd865
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/calendars/brazil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function isholiday(::BRSettlement, dt::Dates.Date)
||
# Proclamacao da Republica
((mm == 11) && (dd == 15))
||
# Dia Nacional de Zumbi e da Consciência Negra
((mm == 11) && (dd == 20) && (yy >= 2024))
||
# Natal
((mm == 12) && (dd == 25))
Expand Down
7 changes: 5 additions & 2 deletions test/calendar_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ test_bdays(:WeekendsOnly, (2019, 8, 23), (2019, 8, 24), 1)
@test isbday(hc_brazil, Dates.Date(2013, 05, 30)) == false # Corpus Christi
@test isbday(hc_brazil, Dates.Date(2013, 05, 31)) == true # friday

@test isbday(hc_brazil, Dates.Date(2023, 11, 20)) == true # zumbi 2023
@test isbday(hc_brazil, Dates.Date(2024, 11, 20)) == false # zumbi 2024

# Symbol
@test isbday(:Brazil, Dates.Date(2013, 05, 29)) == true # wednesday
@test isbday(:Brazil, Dates.Date(2013, 05, 30)) == false # Corpus Christi
Expand Down Expand Up @@ -1184,8 +1187,8 @@ d1 = Dates.Date(2013, 02, 14)
@test d1 == Dates.Date(2013, 02, 14)

d0 = Dates.Date(2015, 06, 29) ; d2 = Dates.Date(2100, 12, 20)
@test bdays(hc_brazil, d0, d2).value == 21471
@test bdayscount(hc_brazil, d0, d2) == 21471
@test bdays(hc_brazil, d0, d2).value == 21416
@test bdayscount(hc_brazil, d0, d2) == 21416

# Tests for Composite Calendar
@test isholiday(hc_composite_BR_USA, Dates.Date(2012,9,3)) # US Labor Day
Expand Down

0 comments on commit eafd865

Please sign in to comment.