Skip to content

Commit

Permalink
fixed hardcoded 2024 while fetching holidays
Browse files Browse the repository at this point in the history
  • Loading branch information
jzyinq committed Jan 8, 2025
1 parent 8ad6bf2 commit b5fb42f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.10.2] - 2025-01-08
### Fixed
- hardcoded `2024` while fetching holidays for given year

## [0.10.1] - 2024-08-11
### Fixed
- uppercase `L` was used instead of lowercase version for latest issues
Expand Down Expand Up @@ -125,7 +129,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- Initial release of gojira

[Unreleased]: https://github.com/jzyinq/gojira/compare/0.10.1...master
[Unreleased]: https://github.com/jzyinq/gojira/compare/0.10.2...master
[0.10.2]: https://github.com/jzyinq/gojira/compare/0.10.1...0.10.2
[0.10.1]: https://github.com/jzyinq/gojira/compare/0.10.0...0.10.1
[0.10.0]: https://github.com/jzyinq/gojira/compare/0.9.0...0.10.0
[0.9.0]: https://github.com/jzyinq/gojira/compare/0.8.1...0.9.0
Expand All @@ -144,4 +149,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
[0.2.2]: https://github.com/jzyinq/gojira/compare/0.2.1...0.2.2
[0.2.1]: https://github.com/jzyinq/gojira/compare/0.2.0...0.2.1
[0.2.0]: https://github.com/jzyinq/gojira/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/jzyinq/gojira/tree/0.1.0
[0.1.0]: https://github.com/jzyinq/gojira/tree/0.1.0
3 changes: 2 additions & 1 deletion gojira/hoilidays.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func (h *Holiday) GetTime() (*time.Time, error) {
}

func getHolidaysForCountry(countryCode string) (*Holidays, error) {
url := fmt.Sprintf("https://date.nager.at/api/v3/PublicHolidays/2024/%s", countryCode)
currentYear := time.Now().Year()
url := fmt.Sprintf("https://date.nager.at/api/v3/PublicHolidays/%d/%s", currentYear, countryCode)
logrus.Infof("fetching holidays from url: %s", url)
resp, err := http.Get(url) //nolint:gosec
if err != nil {
Expand Down

0 comments on commit b5fb42f

Please sign in to comment.