From eafd865aa4374ef0a103499c4dd6c3f0fab9ef37 Mon Sep 17 00:00:00 2001 From: Felipe Noronha Date: Tue, 12 Mar 2024 15:56:00 -0300 Subject: [PATCH] add November 20th to brazilian holidays --- src/calendars/brazil.jl | 3 +++ test/calendar_tests.jl | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/calendars/brazil.jl b/src/calendars/brazil.jl index e3814cf..b1a8a4d 100644 --- a/src/calendars/brazil.jl +++ b/src/calendars/brazil.jl @@ -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)) diff --git a/test/calendar_tests.jl b/test/calendar_tests.jl index f3919a6..a2d3241 100644 --- a/test/calendar_tests.jl +++ b/test/calendar_tests.jl @@ -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 @@ -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