2016-05-13 40 views
0

我正在創建一個MVC應用程序,並且用戶已要求在datetimepicker上是否可以將值切換爲6的間隔。更改DateTimePicker的值

所以在datetimepicker的這一部分:

enter image description here

有沒有辦法來改變值00061218等?

任何幫助表示讚賞。

回答

0

我找到了!

原來的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;