From 4a787c3ae1f81b8020275c17ec25b6d0642dc0a1 Mon Sep 17 00:00:00 2001 From: Felipe Noronha Date: Mon, 28 Dec 2020 23:54:54 -0300 Subject: [PATCH] BrazilExchange calendar adjustments for 2022 --- Project.toml | 2 +- src/calendars/brazil.jl | 2 +- test/calendar_tests.jl | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index c00e4a4..dc390e9 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "4f18b42c-503e-5345-9536-bb0f25fc7038" license = "MIT" authors = ["Felipe Noronha "] repo = "https://github.com/JuliaFinance/BusinessDays.jl.git" -version = "0.9.11" +version = "0.9.12" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/calendars/brazil.jl b/src/calendars/brazil.jl index ec7522e..c202c49 100644 --- a/src/calendars/brazil.jl +++ b/src/calendars/brazil.jl @@ -88,7 +88,7 @@ function isholiday(::BrazilExchange, dt::Dates.Date) if ( # Aniversário de São Paulo - ( mm == 1 && dd == 25 ) + ( mm == 1 && dd == 25 && yy != 2022 ) || # Revolucão ( mm == 7 && dd == 9 && yy != 2020 ) diff --git a/test/calendar_tests.jl b/test/calendar_tests.jl index d9d2f7f..3710b9a 100644 --- a/test/calendar_tests.jl +++ b/test/calendar_tests.jl @@ -228,6 +228,13 @@ test_bdays(:WeekendsOnly, (2019, 8, 23), (2019, 8, 24), 1) @test isbday(hc_brazil_exc, Dates.Date(2020, 07, 09)) == true # 2020 update by Ofício Circular 072/2020-PRE @test isbday(hc_brazil_exc, Dates.Date(2020, 11, 20)) == true # 2020 update by Ofício Circular 072/2020-PRE +# BrazilExchange 2021 calendar +@test isholiday(hc_brazil_exc, Dates.Date(2021, 1, 25)) == true +@test isholiday(hc_brazil_exc, Dates.Date(2021, 7, 9)) == true + +# BrazilExchange 2022 calendar +@test isholiday(hc_brazil_exc, Dates.Date(2022, 1, 25)) == false # updated by Ofício Circular 150/2020-PRE + # USSettlement HolidayCaledar tests # Federal Holidays listed on https://www.opm.gov/policy-data-oversight/snow-dismissal-procedures/federal-holidays/#url=2015 @test isbday(hc_usa, Dates.Date(2014, 12, 31)) == true