andrewmcveigh / cljs-time

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

Problem with formatters list? #116

Closed davclark closed 6 years ago

davclark commented 6 years ago

I'm putting what I suspect is too much info here, but I really have NO idea where the problem is coming from.

In short, I can't view the list of formatters with show-formatters, and I also can explicitly define a working formatter that's (I think) identical to the :basic-date-time formatter, but coerce/from-string won't work on an example date. This makes me think there's some basic problem with the list of formatters.

Here's the packages in :dependencies in my project.clj for leiningen (on windows, running lein figwheel from powershell):

                [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.9.229"]
                 [org.clojure/core.async  "0.3.443"]
                 [rum "0.10.8"]
                 [cljs-http "0.1.43"]
                 [com.andrewmcveigh/cljs-time "0.5.0"]
                 ]

I include format in my ns declaration

(ns scrape-n-mail.core                                            
    (:require [rum.core :as rum]                                  
              [cljs-http.client :as http]                         
              [clojure.string :as s]                              
              [cljs-time.format :as fmt]                          
              [cljs.core.async :refer [<!]])                      
    (:require-macros [cljs.core.async.macros :refer [go go-loop]])
    )                                                             

I'm running this directly at the figwheel repl:

=> (fmt/show-formatters)
:basic-date                             20171105

:basic-date-time                        20171105T014406.842Z

:basic-date-time-no-ms                  20171105T014406Z

:basic-ordinal-date                     2017005

:basic-ordinal-date-time                2017005T014406.842Z

:basic-ordinal-date-time-no-ms          2017005T014406Z

:basic-t-time                           T014406.842Z

:basic-t-time-no-ms                     T014406Z

:basic-time                             014406.842Z

:basic-time-no-ms                       014406Z

#object[Error Error: No matching clause: e]
   cljs_time$internal$unparse$lookup (jar:file:/C:/Users/davcl/.m2/repository/com/andrewmcveigh/cljs-time/0.5.0/cljs-time-0.5.0.jar!/cljs_time/internal/unparse.cljs:131:5)
   cljs.core.PersistentVector.cljs$core$IReduce$_reduce$arity$3 (jar:file:/C:/Users/davcl/.m2/repository/org/clojure/clojurescript/1.9.229/clojurescript-1.9.229.jar!/cljs/core.cljs:19391:3)
   Function.cljs.core.reduce.cljs$core$IFn$_invoke$arity$3 (jar:file:/C:/Users/davcl/.m2/repository/org/clojure/clojurescript/1.9.229/clojurescript-1.9.229.jar!/cljs/core.cljs:2358:29)
   Function.cljs.core.mapv.cljs$core$IFn$_invoke$arity$2 (jar:file:/C:/Users/davcl/.m2/repository/org/clojure/clojurescript/1.9.229/clojurescript-1.9.229.jar!/cljs/core.cljs:4752:11)
   cljs.core/mapv (jar:file:/C:/Users/davcl/.m2/repository/org/clojure/clojurescript/1.9.229/clojurescript-1.9.229.jar!/cljs/core.cljs:4745:1)
   cljs-time.internal.unparse/unparse (jar:file:/C:/Users/davcl/.m2/repository/com/andrewmcveigh/cljs-time/0.5.0/cljs-time-0.5.0.jar!/cljs_time/internal/unparse.cljs:204:19)
   cljs_time$format$unparse (jar:file:/C:/Users/davcl/.m2/repository/com/andrewmcveigh/cljs-time/0.5.0/cljs-time-0.5.0.jar!/cljs_time/format.cljs:249:4)
n

Any ideas?

andrewmcveigh commented 6 years ago

Seems to be due to a parser/formatter that's not been implemented. Marking this as a bug.

 Symbol  Meaning                      Presentation  Examples
 ------  -------                      ------------  -------
 e       day of week                  number        2
davclark commented 6 years ago

Awesome! I was expecting way more yak shaving.