Skip to content

Commit b5fb42f

Browse files
committed
fixed hardcoded 2024 while fetching holidays
1 parent 8ad6bf2 commit b5fb42f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [0.10.2] - 2025-01-08
10+
### Fixed
11+
- hardcoded `2024` while fetching holidays for given year
12+
913
## [0.10.1] - 2024-08-11
1014
### Fixed
1115
- uppercase `L` was used instead of lowercase version for latest issues
@@ -125,7 +129,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
125129
### Added
126130
- Initial release of gojira
127131

128-
[Unreleased]: https://github.com/jzyinq/gojira/compare/0.10.1...master
132+
[Unreleased]: https://github.com/jzyinq/gojira/compare/0.10.2...master
133+
[0.10.2]: https://github.com/jzyinq/gojira/compare/0.10.1...0.10.2
129134
[0.10.1]: https://github.com/jzyinq/gojira/compare/0.10.0...0.10.1
130135
[0.10.0]: https://github.com/jzyinq/gojira/compare/0.9.0...0.10.0
131136
[0.9.0]: https://github.com/jzyinq/gojira/compare/0.8.1...0.9.0
@@ -144,4 +149,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
144149
[0.2.2]: https://github.com/jzyinq/gojira/compare/0.2.1...0.2.2
145150
[0.2.1]: https://github.com/jzyinq/gojira/compare/0.2.0...0.2.1
146151
[0.2.0]: https://github.com/jzyinq/gojira/compare/0.1.0...0.2.0
147-
[0.1.0]: https://github.com/jzyinq/gojira/tree/0.1.0
152+
[0.1.0]: https://github.com/jzyinq/gojira/tree/0.1.0

gojira/hoilidays.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func (h *Holiday) GetTime() (*time.Time, error) {
5656
}
5757

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

0 commit comments

Comments
 (0)