formatTime用“h”代替“:”作为分隔符 [英] formatTime with “h” instead of “:” as separator
问题描述
我在这里找到了一个较旧的帖子:
formatTime与h而不是:作为分隔符
,但解决方案显然不再适用于FullCalendar v2。
有没有办法让我逃避h字符在timeFormat选项?
Fullcalendar使用 Moment.js 日期/时间。
要转义格式字符串中的字符,可以将字符包装到
方括号。
moment()。format('[today] dddd'); //'today Sunday'
这适用于 formatTime
fullcalendar选项:
timeFormat:'H [h](mm)'
In France, we use the following 24 hour format for time: 18h30.
Therefore, I want to add the "h" char in the timeFormat option of FullCalendar 2. I found an older post here: formatTime with "h" instead of ":" as separator but the solution is apparently not working anymore with FullCalendar v2.
Is there a way I could "escape" the "h" character in the timeFormat option ?
Fullcalendar uses Moment.js for date/times.
To escape characters in format strings, you can wrap the characters in square brackets.
moment().format('[today] dddd'); // 'today Sunday'
This works for the formatTime
fullcalendar option too:
timeFormat: 'H[h](mm)'
这篇关于formatTime用“h”代替“:”作为分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!