【问题标题】:Date settings fullCalendar日期设置 fullCalendar
【发布时间】:2012-03-11 16:40:53
【问题描述】:

我在fullCalendar 中设置了活动开始的日期:月/日/年,例如“02/25/2012”。但是我想要这种格式的日/月/年,我该怎么做?

我试过使用这个表达式$.fullCalendar.formatDate( date,'dd/MM/yyyy');

但是当我以这种格式插入日期时,我的日历会在错误的日期加载事件。 例如,应该在 2 月 29 日开始的事件在 2 月 1 日加载。

为什么?

【问题讨论】:

    标签: jquery jquery-plugins fullcalendar


    【解决方案1】:

    formatDate 用于将日期转换为字符串。看来您想做相反的事情 - 将字符串解析为日期。有一个完整的日历 parseDate,但它仅适用于 ISO8601 格式、IETF 格式或 UNIX 时间戳。

    请参阅here 获取有关转换日期格式的帮助。

    【讨论】:

      【解决方案2】:

      使用这个:

      $.fullCalendar.formatDate( date, formatString [, options ] );
      

      在此处查看规格:http://arshaw.com/fullcalendar/docs/utilities/formatDate/

      【讨论】:

        猜你喜欢
        • 2013-11-26
        • 1970-01-01
        • 1970-01-01
        • 2015-01-08
        • 2013-07-11
        • 1970-01-01
        • 1970-01-01
        • 2020-01-24
        • 2021-11-12
        相关资源
        最近更新 更多