1
0
Fork 0
mirror of https://github.com/Luzifer/go-holidays.git synced 2024-12-25 21:31:17 +00:00

Fix: Sorting now is a string comparison

This commit is contained in:
Knut Ahlers 2016-09-24 14:28:50 +02:00
parent ec9779f118
commit 494749a578
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -28,7 +28,7 @@ type Holiday struct {
type holidays []Holiday type holidays []Holiday
func (h holidays) Len() int { return len(h) } func (h holidays) Len() int { return len(h) }
func (h holidays) Less(i, j int) bool { return h[i].Date.Before(h[j].Date) } func (h holidays) Less(i, j int) bool { return h[i].Date < h[j].Date }
func (h holidays) Swap(i, j int) { h[i], h[j] = h[j], h[i] } func (h holidays) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
// GetHolidays returns the holidays for the given ISO 3166-2 countryCode and year // GetHolidays returns the holidays for the given ISO 3166-2 countryCode and year