2013-10-16 25 views
-2

我有jQuery.ptTimeSelect插件,這似乎對我的項目很好。 不知道是有一個24小時的格式,因爲我遇到的例子[http://pttimeselect.sourceforge.net/example/index.html][1]這個插件是否有24小時的時間格式?

[1]: http://pttimeselect.sourceforge.net/example/index.html只有12小時時間格式。

下面

從上述網站的代碼片段

$('input[name="time"]') 
    .ptTimeSelect({ 
     containerClass: undefined, 
     containerWidth: undefined, 
     hoursLabel:  'Hour', 
     minutesLabel: 'Minutes', 
     setButtonLabel: 'Set', 
     popupImage:  undefined, 
     onFocusDisplay: true, 
     zIndex:   10, 
     onBeforeShow: undefined, 
     onClose:  undefined 
    }); 
+2

這裏有幾乎沒有足夠的信息。你使用什麼插件?你寫了什麼代碼來實例化插件?你有這個問題的一個有效的例子嗎? –

回答

1

在選擇使用24小時:

timeFormat: "HH:mm" 

12小時上午下午:

timeFormat: "hh:mm" 

或者使用H:i爲24h和h:i for 12h

確切的選項和格式取決於你的庫/插件,但主要是因爲hH

data-options=\'{"mode": "timebox", "overrideTimeFormat": 24, "timeFormat": "H:i"}\'