From 72f2d5ccabe21e7bf4f78e07f7ede7adac5ea8fe Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 6 Feb 2024 13:15:59 +0200 Subject: [PATCH 1/2] Remove holidays slice length --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 57e3f8d..6c2adc6 100644 --- a/main.go +++ b/main.go @@ -50,10 +50,10 @@ func main() { } } -func getHolidays(year int) ([15]Holiday, error) { +func getHolidays(year int) ([]Holiday, error) { orthodoxEaster, err := eastertime.OrthodoxByYear(year) if err != nil { - return [15]Holiday{}, errors.New("the year must be greater than 325") + return []Holiday{}, errors.New("the year must be greater than 325") } easter := carbon.CreateFromStdTime(orthodoxEaster) @@ -62,7 +62,7 @@ func getHolidays(year int) ([15]Holiday, error) { whitMonday := easter.AddDays(50) whitSunday := whitMonday.SubDay() - holidays := [15]Holiday{ + holidays := []Holiday{ { Name: "Anul nou", Date: carbon.CreateFromDate(year, 1, 1).ToDateString(), From ec18a7a4d24dc9142a71a2bf9f4f8e27d8b67b20 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 6 Feb 2024 13:18:17 +0200 Subject: [PATCH 2/2] Add 6th and 7th of January holidays --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index 6c2adc6..9f87057 100644 --- a/main.go +++ b/main.go @@ -71,6 +71,14 @@ func getHolidays(year int) ([]Holiday, error) { Name: "Anul nou", Date: carbon.CreateFromDate(year, 1, 2).ToDateString(), }, + { + Name: "Bobotează", + Date: carbon.CreateFromDate(year, 1, 6).ToDateString(), + }, + { + Name: "Soborul Sfântului Ioan Botezătorul", + Date: carbon.CreateFromDate(year, 1, 7).ToDateString(), + }, { Name: "Ziua Unirii", Date: carbon.CreateFromDate(year, 1, 24).ToDateString(),