Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sivakumargsk opened this issue Mar 22, 2017 · 1 comment
Open

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

sivakumargsk opened this issue Mar 22, 2017 · 1 comment

Comments

@sivakumargsk
Copy link

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")
  • #error {:message "The parser could not match the input string.", :data {:type :parser-no-match}}
  • new (jar:file:/home/sivakumar/.m2/repository/org/clojure/clojurescript/1.9.494/clojurescript-1.9.494.jar!/cljs/core.cljs:34703:10)
  • Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (jar:file:/home/sivakumar/.m2/repository/org/clojure/clojurescript/1.9.494/clojurescript-1.9.494.jar!/cljs/core.cljs:34779:9)
  • Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$2 (jar:file:/home/sivakumar/.m2/repository/org/clojure/clojurescript/1.9.494/clojurescript-1.9.494.jar!/cljs/core.cljs:10244:17)
  • cljs.core/ex-info (jar:file:/home/sivakumar/.m2/repository/org/clojure/clojurescript/1.9.494/clojurescript-1.9.494.jar!/cljs/core.cljs:10237:34)
  • cljs-time.format/parse* (jar:file:/home/sivakumar/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar!/cljs_time/format.cljs:421:11)
  • Function.cljs_time.format.parse.cljs$core$IFn$_invoke$arity$2 (jar:file:/home/sivakumar/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar!/cljs_time/format.cljs:428:7)
  • cljs_time$format$parse (jar:file:/home/sivakumar/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar!/cljs_time/format.cljs:424:1)
@VyacheslavMik
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants