我有一个看起来像这样的约会:
Thu May 21 2015 10:28:49 GMT-0500 (Central Daylight Time)
它来自 fullCalendar.getDate()
我需要将这种格式的日期格式化/解析为类似 mm/dd/yyyy 的格式。
最佳答案
由于 fullcalendar 使用 moment js [ http://fullcalendar.io/docs/utilities/date_formatting_string/ ], 你可以尝试下面的代码.. 如果你没有包含 moment js.. 包含它然后尝试..
moment(fullCalendar.getDate()).format("mm/DD/YYYY");
关于javascript - 无法格式化/解析此日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30378205/