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:
parent
aadbd5adf3
commit
30d4b8986a
2 changed files with 27 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue