Fork me on GitHub
#juxt
<
2020-03-23
>
roklenarcic18:03:58

I’ve been using Tick and I cannot find a function to parse a date like “dd.MM.yyyy”

dcj18:03:51

I've gone the other way, that is, formatting a tick time into a string:

created-at        (-> (t/new-time hour minute second)
                                (t/on (t/new-date year month day))
                                (t/in "UTC"))
          created-at-string (t/format (tick.format/formatter "yyyy-MM-dd") created-at)

dcj18:03:16

I will want/need to do parsing also....

roklenarcic18:03:44

not having parsing is a big downside compared to cljs-time

dcj18:03:29

(-> (t/date "1918-11-11") (t/at "11:00"))
I'm still looking....

dcj18:03:15

(t/date (t/instant "1999-12-31T23:59:59"))

roklenarcic18:03:44

Java 8 Time that this is based on doesn’t have a concept of an open interval

dcj19:03:02

Specifically the last comment

dcj19:03:32

So:

(cljc.java-time.local-date/parse "03-05-2020" (t/formatter "dd-MM-yyyy"))
#time/date "2020-05-03"

(cljc.java-time.local-date/parse "03052020" (t/formatter "ddMMyyyy"))
#time/date "2020-05-03"

roklenarcic19:03:39

what about cljs?

dcj19:03:44

IDK, I am JVM-first/mostly kind of person....

dcj19:03:42

But I'm still interested, I have a CLJ/CLJS webapp that deals a lot with time....I was hoping to unify the front and back end time stuff....

roklenarcic19:03:45

seems to be working

dcj19:03:02

on cljs?

dcj19:03:22

Well that is good news....so it seems that there is a path forward for time parsing....