1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-27 17:28:38 +00:00

Avoid "pq: time zone displacement out of range" errors

This commit is contained in:
Frédéric Guillot 2023-06-24 15:02:33 -07:00
parent aadbd5adf3
commit 30d4b8986a
2 changed files with 27 additions and 0 deletions

View file

@ -187,3 +187,16 @@ func TestParseWeirdDateFormat(t *testing.T) {
}
}
}
func TestParseDateWithTimezoneOutOfRange(t *testing.T) {
date, err := Parse("2023-05-29 00:00:00-23:00")
if err != nil {
t.Errorf(`Unable to parse date: %v`, err)
}
_, offset := date.Zone()
if offset != 0 {
t.Errorf(`The offset should be reinitialized to 0 instead of %v because it's out of range`, offset)
}
}