Skip to content

Commit

Permalink
Merge pull request #41 from backdevs/40-add-6th-and-7th-of-january
Browse files Browse the repository at this point in the history
Add 6th and 7th of January
  • Loading branch information
bogdannbv authored Feb 6, 2024
2 parents 412400d + ec18a7a commit 9f91432
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(),
Expand All @@ -71,6 +71,14 @@ func getHolidays(year int) ([15]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(),
Expand Down

0 comments on commit 9f91432

Please # to comment.