andrewmcveigh / cljs-time

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

Ensure to-local-date doesn't convert local-dates again #82

Closed arttuka closed 7 years ago

arttuka commented 7 years ago

Currently, to-local-date doesn't check if the parameter is already a local date. It always converts the parameter to UTC datetime at midnight (UTC). If the current time zone offset is positive, the result is on the previous day:

cljs.user=> (cljs-time.core/local-date 2016 12 13)
#object[Object 20161213]
cljs.user=> (cljs-time.coerce/to-local-date (cljs-time.core/local-date 2016 12 13))
#object[Object 20161212]
andrewmcveigh commented 7 years ago

Awesome, thanks!