andrewmcveigh / cljs-time

A clj-time inspired date library for clojurescript.
342 stars 57 forks source link

Unparsing date with "yy" not returning century year #144

Closed m-arch closed 3 years ago

m-arch commented 3 years ago

Current behaviour:

(timef/parse (timef/formatter "dd/MM/yy") "31/12/20") => #object[Object 201231T000000]

Expected behaviour:

(timef/parse (timef/formatter "dd/MM/yy") "31/12/20") => #object[Object 20201231T000000]

I expect the year to be year of the century we're currently in and not year 20 in this eg.

andrewmcveigh commented 3 years ago

This is odd as there's a test case checking this.

What clojurescript version is this occurring with?

m-arch commented 3 years ago

The dependencies are the following:

[org.clojure/clojurescript "1.10.339"]
[com.andrewmcveigh/cljs-time "0.4.0"]

I will try to update to latest cljs-time :) I just noticed that the version I am using is a bit outdated

m-arch commented 3 years ago

Yes indeed, updating solved the issue. Sorry for the inconvenience it's an old project and in some cases i prefer not to change dependencies versions, but i think with this case should be fine.