我已经在我的网站上集成了bootstrap datetimepicker,并进行了一些个性化设置。 问题是,当我选择月份格式时,我有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
}
答案 0 :(得分:0)
试试这个
<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: ''
}
});
});