purescript-precise-datetime icon indicating copy to clipboard operation
purescript-precise-datetime copied to clipboard

`DateTime.Year` is out of range

Open themattchan opened this issue 6 years ago • 0 comments

Given the following underlying DateTime objects, I get the following invalid RFC3339Strings:

 (DateTime (Date (Year 97147) December (Day 26)) (Time (Hour 3) (Minute 36) (Second 4) (Millisecond 729)))

97147-12-26T03:36:04.729569335Z
(DateTime (Date (Year -114165) February (Day 12)) (Time (Hour 16) (Minute 32) (Second 8) (Millisecond 241)))

000-114165-02-12T16:32:08.241663734Z

The problem is while RFC3339 expects a year in the inclusive range 0-9999, the range for DateTime.Year is

instance boundedYear :: Bounded Year where
  bottom = Year (-271820)
  top = Year 275759

themattchan avatar Apr 13 '18 00:04 themattchan