clojure / clojurescript-site

website for ClojureScript
Eclipse Public License 1.0
107 stars 135 forks source link

Update "Differences" for inst calendar #367

Open mfikes opened 3 years ago

mfikes commented 3 years ago

When #inst values are parsed and printed in Clojure, by default the Gregorian calendar is used. In particular, this is a hybrid Julian / Gregorian calendar with a changeover in 1582.

On the other hand, ClojureScript uses the JavaScripts Date type for #inst values, which employs a proleptic Gregorian calendar. This host-specific aspect is reflected in #inst parsing and printing.

A consequence of this difference in default #inst handling is that older dates will be interpreted differently. For example #inst "1500" denotes two different instances in time in Clojure vs. ClojureScript.

This could be detailed in the "Differences" page, perhaps in the reader section.

mfikes commented 3 years ago

As an aside, note that CLJS-3291 addresses an issue related to this for the parsing of #inst values in code. (Runtime handling has always been in the proleptic Gregorian calendar.)