Closed liquidz closed 3 years ago
The following code returns expected value with v0.3.2 while v0.3.3 throws Exception.
(require '[java-time :as j]) (j/as (j/zoned-date-time) :instant-seconds))
(j/as (j/zoned-date-time) :instant-seconds)) should return integer.
(j/as (j/zoned-date-time) :instant-seconds))
Throws the following exception.
java.time.DateTimeException: Property :instant-seconds doesn't exist in [2021-10-27T15:34:44.773+09:00[Asia/Tokyo]]!
java-time.properties/chrono-fields does'nt have a field for :instant-seconds, so I added missing fields.
java-time.properties/chrono-fields
:instant-seconds
(clojure.set/difference (set (keys (->map (vals (jt.u/get-static-fields-of-type ChronoField TemporalField))))) (set (keys (->map chrono-fields)))) ;; => #{:aligned-week-of-month :epoch-day :aligned-week-of-year :minute-of-day :clock-hour-of-day :instant-seconds :aligned-day-of-week-in-month :am-pm-of-day :aligned-day-of-week-in-year :clock-hour-of-am-pm :minute-of-hour}
Looks good. Thanks! Sorry for the delay... It looks like this brings backs the 0.3.2 behaviour.
Problem
The following code returns expected value with v0.3.2 while v0.3.3 throws Exception.
Expected
(j/as (j/zoned-date-time) :instant-seconds))
should return integer.Actual
Throws the following exception.
How to solve
java-time.properties/chrono-fields
does'nt have a field for:instant-seconds
, so I added missing fields.