From 8e1fbae9c5caef50c6dc850689bde2d621990d64 Mon Sep 17 00:00:00 2001 From: Isabelle Oliveira Date: Tue, 23 Jan 2024 14:25:50 -0300 Subject: [PATCH] add new national holiday --- v2/br/br_holidays.go | 9 +++++++++ v2/br/br_holidays_test.go | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/v2/br/br_holidays.go b/v2/br/br_holidays.go index d6d2e1b..df11f7e 100644 --- a/v2/br/br_holidays.go +++ b/v2/br/br_holidays.go @@ -74,6 +74,14 @@ var ( // Natal represents Christmas Day on 25-Dec Natal = aa.ChristmasDay.Clone(&cal.Holiday{Name: "Natal", Type: cal.ObservancePublic}) + // ConscienciaNegra represents Black Awareness Day on 20-Nov + ConscienciaNegra = &cal.Holiday{ + Name: "Dia da Consciência Negra", + Month: time.November, + Day: 20, + Func: cal.CalcDayOfMonth, + } + // Holidays provides a list of the standard national holidays Holidays = []*cal.Holiday{ AnoNovo, @@ -87,5 +95,6 @@ var ( SextaFeiraSanta, Carnaval, Natal, + ConscienciaNegra, } ) diff --git a/v2/br/br_holidays_test.go b/v2/br/br_holidays_test.go index 3249e44..39654b1 100644 --- a/v2/br/br_holidays_test.go +++ b/v2/br/br_holidays_test.go @@ -119,6 +119,17 @@ func TestHolidays(t *testing.T) { {Natal, 2020, d(2020, 12, 25), d(2020, 12, 25)}, {Natal, 2021, d(2021, 12, 25), d(2021, 12, 25)}, {Natal, 2022, d(2022, 12, 25), d(2022, 12, 25)}, + + {ConscienciaNegra, 2015, d(2015, 11, 20), d(2015, 11, 20)}, + {ConscienciaNegra, 2016, d(2016, 11, 20), d(2016, 11, 20)}, + {ConscienciaNegra, 2017, d(2017, 11, 20), d(2017, 11, 20)}, + {ConscienciaNegra, 2018, d(2018, 11, 20), d(2018, 11, 20)}, + {ConscienciaNegra, 2019, d(2019, 11, 20), d(2019, 11, 20)}, + {ConscienciaNegra, 2020, d(2020, 11, 20), d(2020, 11, 20)}, + {ConscienciaNegra, 2021, d(2021, 11, 20), d(2021, 11, 20)}, + {ConscienciaNegra, 2022, d(2022, 11, 20), d(2022, 11, 20)}, + {ConscienciaNegra, 2023, d(2023, 11, 20), d(2023, 11, 20)}, + {ConscienciaNegra, 2024, d(2024, 11, 20), d(2024, 11, 20)}, } for _, test := range tests {