Bootstrap datetimePicker月视图

Bootstrap datetimePicker months view

我在我的网站上集成了 bootstrap 日期时间选择器,并进行了一些个性化设置。 问题是当我选择月份格式时,我有 3 行不同的月数 4-5-3 我想将每 4 个月放在一行中。有帮助吗?

JavaScript

var currentTime = new Date()
var minDate = new Date(currentTime.getFullYear(), currentTime.getMonth());

//init dateTimePicker
var params = {
  locale: 'fr',
  clear: "Clear",
  useCurrent: true,
  minDate: minDate,
  stepping: 5,
  format: 'MM/YYYY',
  icons: {
    previous: '',
    next: ''
  },
  inline: false
}

screenshot of the timePicker

试试这个

<div class="row">
  <div class="col-md-12">
    <h6>Datetimepicker</h6>
    <div class="form-group">
      <div class="input-group date" id="datetimepicker">
        <input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span>
      </div>
    </div>
  </div>

JavaScript

$(function() {
  var date = new Date();
  var currentMonth = date.getMonth();
  var currentDate = date.getDate();
  var currentYear = date.getFullYear();  
  $('#datetimepicker').datetimepicker({
    locale: 'fr',
    clear: "Clear",
    useCurrent: true,
    minDate: new Date(currentYear, currentMonth, currentDate),
    stepping: 5,
    format: 'MM/YYYY',
    icons: {
      previous: '',
      next: ''
    }
  });
});

Demo on fiddle