【问题标题】:How to shorten date in telescope app?如何在望远镜应用程序中缩短日期?
【发布时间】:2015-05-06 10:35:25
【问题描述】:

我正在使用望远镜应用程序。目前在我的帖子标题模板中,我使用 scheduleAt 来显示事件发生的日期。我想将日期缩短到 2015 年 5 月 7 日星期四,但我真的不知道该怎么做。

【问题讨论】:

    标签: date meteor telescope


    【解决方案1】:

    在 Telescope 中,有一个名为 formatDate 的助手专门为此目的而设计,只需像这样在模板中调用它:

    {{formatDate scheduledAt "ddd MMMM DD YYYY"}}
    

    在底层,它使用momentjs 来显示日期对象。

    http://momentjs.com/docs/#/displaying/

    【讨论】:

    • 或者,对于整月:“ddd MMMM DD YYYY”
    • 优秀。谢谢大家!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多