Search code examples
javascriptclojureclojurescriptomreagent

How to invoke .toDateString() on Date object in Clojurescript


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

Solution

  • (.toDateString (js/Date. 1420971497471))