formatTime with “h” instead of “:” as separator

不问归期 提交于 2019-12-06 06:01:28

You need to use single quotes inside the javascript string to insert the letter h as literal text. The easiest way for this is to use double quotes as string delimiters, as in:

timeFormat: "H'h'(mm)"

For reference, if you want to use single quotes inside a single quoted string, use an escape for each quote, as in:

timeFormat: 'H\'h\'(mm)'
pab

An up-to-date solution is reported here and works for FullCalendar2: formatTime with “h” instead of “:” as separator

Escaping Characters:

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)'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!