3

I'm trying to get the DateString in Clojurescript: new Date(1420971497471).toDateString();

I am having trouble because (js/Date 1420971497471) returns a string, so I can't call .toDateString().

Here's my Clojurescript code:

(.toDateString (js/Date 1420971497471)) 
// Uncaught TypeError: undefined is not a function
hzhu
  • 3,759
  • 5
  • 29
  • 39

1 Answers1

8
(.toDateString (js/Date. 1420971497471)) 
myguidingstar
  • 673
  • 4
  • 10
  • 1
    (Foo. bar) is shorthand for (new Foo bar) in both clojure and clojurescript: http://clojure.org/java_interop#Java%20Interop-The%20Dot%20special%20form-(Classname.%20args%2a) –  Jan 11 '15 at 21:46