我們在葡萄牙使用以下24小時制格式:18h30
。 我試過了:formatTime以「h」代替「:」作爲分隔符
timeFormat: 'H'h'(mm)'
timeFormat: {'H'h'(mm)'}
timeFormat: 'H\h(mm)'
這可能嗎? 謝謝。
我們在葡萄牙使用以下24小時制格式:18h30
。 我試過了:formatTime以「h」代替「:」作爲分隔符
timeFormat: 'H'h'(mm)'
timeFormat: {'H'h'(mm)'}
timeFormat: 'H\h(mm)'
這可能嗎? 謝謝。
您需要使用單引號裏面的 javascript字符串來插入字母h
作爲文字文本。造成這種情況的最簡單的方法是用雙引號作爲字符串分隔符,如:
timeFormat: "H'h'(mm)"
僅供參考,如果你想使用單引號一個單引號字符內,使用轉義爲每個報價,如:
timeFormat: 'H\'h\'(mm)'
的最高最新的解決方案在這裏報道,並適用於FullCalendar2:formatTime with 「h」 instead of 「:」 as separator
轉義字符:
要轉義格式字符串中的字符,可以將字符包裝在方括號中。
moment().format('[today] dddd'); // 'today Sunday'
該方法適用於formatTime fullcalendar選項太多:
timeFormat: 'H[h](mm)'
哪個插件您使用的?這不是jQuery核心,是嗎? – KarlsFriend 2011-05-30 13:03:07
@KarlsFriend:標記'fullcalendar'看起來像一個強烈的暗示。 – Jerome 2011-05-30 13:09:27