Closed as not planned
Closed as not planned
Description
Parsing of course has the equivalent issue:
iso8601ParseM @IO @CalendarDiffTime "P-1MT-1S"
*** Exception: user error (no parse of "P-1MT-1S")
Whilst it seems like the ISO8601 standard may not explicitly support negative interval durations, the Haskell type does, and a variety of tools including PostgreSQL understand negative values within intervals, so I think crashing here is a greater evil than extending the formatting standard to support values the type already supports.
As an example reference: PostgreSQL specifically supports minus signs in the components but not a preceding sign over the entire time interval:
select 'P-1MT1H-1S' :: interval;
P-1MT59M59S
select 'P-1MT1S' :: interval;
P-1MT1S
select 'P-1MT-1S' :: interval;
P-1MT-1S
select '-P1MT1S' :: interval;
ERROR: invalid input syntax for type interval: "-P1MT1S"
Metadata
Metadata
Assignees
Labels
No labels