Skip to content

Commit c86cd40

Browse files
committed
update BrazilExchange calendar: B3 no longer follows local holidays in Sao Paulo
1 parent f187c87 commit c86cd40

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "4f18b42c-503e-5345-9536-bb0f25fc7038"
33
license = "MIT"
44
authors = ["Felipe Noronha <felipenoris@gmail.com>"]
55
repo = "https://github.com/JuliaFinance/BusinessDays.jl.git"
6-
version = "0.9.14"
6+
version = "0.9.15"
77

88
[deps]
99
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/calendars/brazil.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ function isholiday(::BrazilExchange, dt::Dates.Date)
8888

8989
if (
9090
# Aniversário de São Paulo
91-
( mm == 1 && dd == 25 && yy != 2022 )
91+
( mm == 1 && dd == 25 && yy < 2022 )
9292
||
9393
# Revolucão
94-
( mm == 7 && dd == 9 && yy != 2020 )
94+
( mm == 7 && dd == 9 && yy != 2020 && yy < 2022 )
9595
||
9696
# Consciência Negra (since 2007)
97-
( yy >= 2007 && mm == 11 && dd == 20 && yy != 2020 )
97+
( yy >= 2007 && mm == 11 && dd == 20 && yy != 2020 && yy < 2022 )
9898
# Christmas Eve
9999
||
100100
( mm == 12 && dd == 24)

test/calendar_tests.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,35 @@ test_bdays(:WeekendsOnly, (2019, 8, 23), (2019, 8, 24), 1)
234234

235235
# BrazilExchange 2022 calendar
236236
@test isholiday(hc_brazil_exc, Dates.Date(2022, 1, 25)) == false # updated by Ofício Circular 150/2020-PRE
237+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 7, 9)) == false
238+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 11, 20)) == false
239+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 2, 28)) == true
240+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 3, 1)) == true
241+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 4, 15)) == true
242+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 4, 21)) == true
243+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 6, 16)) == true
244+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 9, 7)) == true
245+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 10, 12)) == true
246+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 11, 2)) == true
247+
@test isholiday(hc_brazil_exc, Dates.Date(2022, 11, 15)) == true
248+
249+
@test BusinessDays.listholidays(hc_brazil_exc, Dates.Date(2022, 1, 1), Dates.Date(2022, 12, 31)) == [
250+
Dates.Date("2022-01-01"), # Confraternização Universal (Sábado)
251+
Dates.Date("2022-02-28"), # Carnaval (segunda)
252+
Dates.Date("2022-03-01"), # Carnaval (Terça)
253+
Dates.Date("2022-04-15"), # Paixão de Cristo
254+
Dates.Date("2022-04-21"), # Tiradentes
255+
Dates.Date("2022-05-01"), # Dia do Trabalho (Domingo)
256+
Dates.Date("2022-06-16"), # Corpus Christi
257+
Dates.Date("2022-09-07"), # Independência do Brasil
258+
Dates.Date("2022-10-12"), # Nossa Senhora Aparecida
259+
Dates.Date("2022-11-02"), # Finados
260+
Dates.Date("2022-11-15"), # Proclamação da República
261+
Dates.Date("2022-12-24"), # Véspera de Natal (sábado)
262+
Dates.Date("2022-12-25"), # Natal (Domingo)
263+
Dates.Date("2022-12-30"), # Véspera do ano novo
264+
Dates.Date("2022-12-31") # Ano novo (Sábado)
265+
]
237266

238267
# USSettlement HolidayCaledar tests
239268
# Federal Holidays listed on https://www.opm.gov/policy-data-oversight/snow-dismissal-procedures/federal-holidays/#url=2015

0 commit comments

Comments
 (0)