0
我正在創建一個MVC應用程序,並且用戶已要求在datetimepicker
上是否可以將值切換爲6
的間隔。更改DateTimePicker的值
所以在datetimepicker
的這一部分:
有沒有辦法來改變值00
,06
,12
,18
等?
任何幫助表示讚賞。
我正在創建一個MVC應用程序,並且用戶已要求在datetimepicker
上是否可以將值切換爲6
的間隔。更改DateTimePicker的值
所以在datetimepicker
的這一部分:
有沒有辦法來改變值00
,06
,12
,18
等?
任何幫助表示讚賞。
我找到了!
原來的DateTimePicker是基於關閉的這一點:
fillMinutes = function() {
var table = widget.find('.timepicker-minutes table'),
currentMinute = viewDate.clone().startOf('h'),
html = [],
row = $('<tr>'),
step = options.stepping === 1 ? 5 : options.stepping;
while (viewDate.isSame(currentMinute, 'h')) {
if (currentMinute.minute() % (step * 4) === 0) {
row = $('<tr>');
html.push(row);
}
row.append('<td data-action="selectMinute" class="minute' + (!isValid(currentMinute, 'm') ? ' disabled' : '') + '">' + currentMinute.format('mm') + '</td>');
currentMinute.add(step, 'm');
}
table.empty().append(html);
},
所以我改變了step = options.stepping === 1 ? 5 : options.stepping;
到:
step = options.stepping === 1 ? 6 : options.stepping;