如何在MobiScroll中设置24小时格式?

use*_*333 3 jquery-mobile mobiscroll

我正在使用最新版本的MobiScroll datetime插件,我需要在没有AM/PM的情况下以24小时格式显示日期,所以我这样做

$('#datetime-start, #datetime-end').mobiscroll().datetime({
    minDate: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
    display: 'modal',
    animate: 'pop',
    mode: 'mixed',
    // 2013-03-15 11:26:17
    dateFormat: 'yy-mm-dd',
    timeFormat: 'HH:ii:ss',
    timeWheels: 'hhii'
});
Run Code Online (Sandbox Code Playgroud)

但仍然有12h格式......有没有办法设置24格式?

Gaj*_*res 5

您的timeWheels属性是incoreect,将其更改为:

$('#datetime-start, #datetime-end').mobiscroll().datetime({
    minDate: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
    display: 'modal',
    animate: 'pop',
    mode: 'mixed',
    // 2013-03-15 11:26:17
    dateFormat: 'yy-mm-dd',
    timeFormat: 'HH:ii:ss',
    timeWheels: 'HHii'
});
Run Code Online (Sandbox Code Playgroud)

所以改变这个:

timeWheels: 'hhii'
Run Code Online (Sandbox Code Playgroud)

对此:

timeWheels: 'HHii'
Run Code Online (Sandbox Code Playgroud)