Support Infinity values for Date type

Then it is very probable that ‘Calendar.ISO’ is not the thing you want. Instead, what about creating your own Calendar implementation (which might heavily lean on the functions provided by Calendar.ISO.) combined with your own custom Ecto.Type so Ecto knows to use your calendar module rather than Calendar.ISO.

I believe the restriction on -9999...9999 was put in place to simplify the parsing of the year part of the date (i.e. by being more strict/conservative in the format the year part could take).

2 Likes

Indeed, if I recall, parsing ISO8601 dates using binary pattern matching based upon 4 digits.

1 Like

Unfortunately, the reasoning for -9999 and 9999 as limits are related to the ISO8601 format.

However (funny) they have been misinterpreted, ISO8601 allows only years between 0000 and 9999, not -9999.

It’s possible to use bigger years, but it’s an agreement that is performed between the sender and the receiver (in this case, the developer and the Elixir development team).

Personally, since Elixir is already “at fault”, might as well increase the size.

1 Like