malli

https://github.com/metosin/malli :malli:
2020-11-02T11:29:10.397200Z

is this a valid instant? it can be represented by Instant, but it appears to not be parsable by malli.transform:

(pr-str (mt/-string->date "0000-12-31T23:59:59.999Z"))
=> "0000-12-31T23:59:59.999Z"

2020-11-02T11:31:08.397900Z

1. Caused by java.time.DateTimeException
   Invalid value for YearOfEra (valid values 1 -
   999999999/1000000000): 0
apparently that's the issue

2020-11-02T11:33:12.398600Z

seems like a inconsistency to me to what Instant can represent and DateTime can parse

ikitommi 2020-11-02T20:40:24.400800Z

@lmergen inst? should be companioned with set of date-types, the issue is here: https://github.com/metosin/malli/issues/49. That said, we just merged an enhancement to inst? transformation, happy to take another one, if there is something still missing. See https://github.com/metosin/malli/pull/280

2020-11-02T20:41:17.401900Z

I’ll take a look, thanks! This is a corner case anyway

👍 1
2020-11-02T20:42:22.403200Z

looks like this may indeed fix my issue as it’s the same instant -> date -> instant round trip, I’ll give it a try