andrewmcveigh / cljs-time

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

parse fails for this format "dd-MMM-yyyy kk:mm aa" #90

Open sivakumargsk opened 7 years ago

sivakumargsk commented 7 years ago

This Works fine with simple format in issue #64

cljs.user=> (require '[cljs-time.format :as fmt])
nil
cljs.user=> (def yyyy-MM-dd (fmt/formatter "yyyy-MM-dd"))
#'cljs.user/yyyy-MM-dd
cljs.user=> (fmt/parse yyyy-MM-dd "2013-04-01")
#object[Object 20130401T000000]

But for this format "dd-MMM-yyyy kk:mm aa" I got an error.

cljs.user=> (def my-formatter (fmt/formatter "dd-MMM-yyyy kk:mm aa"))
#'cljs.user/my-formatter
cljs.user=> (fmt/parse my-formatter "05-Dec-1992 12:00 PM")
VyacheslavMik commented 6 years ago

Hello, @sivakumargsk. aa is not a valid pattern. Only a or A allowed for meridiem.