@doglooksgood I also noticed that I need a locale package to do any formatting, but then I found the Intl.DateTimeFormat browser api that solved it in a for me better way.
(defn intl-format
"Format dates with the Intl.DateTimeFormat browser API"
[locale options date]
(.format (js/Intl.DateTimeFormat. locale (clj->js options))
(t/inst date)))
(intl-format "sv-SE" {:weekday "long" :year "numeric" :month "short" :day "numeric"} dt)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat@maxt Hi, what is the Intl.DateTimeFormat
?
@doglooksgood See updated message (I hit enter to early)
thanks for the example!
Why Intl.DateTimeFormat
can be used for js-joda?
It's only for inst
. I simply convert js-joda times to inst with (t/inst dt)
before passing it to Intl.DateTimeFormat.
@maxt Thanks!