【问题标题】:How to invoke .toDateString() on Date object in Clojurescript如何在 Clojurescript 中的 Date 对象上调用 .toDateString()
【发布时间】:2015-01-11 17:28:20
【问题描述】:

我正在尝试在 Clojurescript 中获取 DateString:new Date(1420971497471).toDateString();

我遇到了麻烦,因为(js/Date 1420971497471) 返回一个字符串,所以我不能调用.toDateString()

这是我的 Clojurescript 代码:

(.toDateString (js/Date 1420971497471)) 
// Uncaught TypeError: undefined is not a function

【问题讨论】:

    标签: javascript clojure clojurescript om reagent


    【解决方案1】:
    (.toDateString (js/Date. 1420971497471)) 
    

    【讨论】:

    • (Foo.bar) 是 clojure 和 clojurescript 中 (new Foo bar) 的简写:clojure.org/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-14
    • 2011-09-30
    • 1970-01-01
    • 2021-09-29
    • 1970-01-01
    • 2010-11-08
    相关资源
    最近更新 更多