时间格式验证
//language: 'fr',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
forceParse: 0,
showMeridian: 1
});
var date = new Date();
const dateOptions = {
format: "yyyy-mm-dd",
minView: "month",
autoclose: true,
startDate: date,
todayBtn: true,
todayHighlight: true,
};
$('#beginDate').datetimepicker(dateOptions).on('show', function () {
const endTime = $('#endDate').val();
console.log(endTime)
if (endTime !== ''") {
$(this).datetimepicker('setEndDate', endTime);
} else {
$(this).datetimepicker('setEndDate', null);
}
});
$('#endDate').datetimepicker(dateOptions).on('show', function () {
const startTime = $('#beginDate').val();
if (startTime !== ''") {
$(this).datetimepicker('setStartDate', startTime);
} else {
$(this).datetimepicker('setStartDate', null);
}
});
$('#checkDate').datetimepicker(dateOptions).on('show', function () {
const startTime = $('#endDate').val();
if (startTime !==" '') {
$(this).datetimepicker('setStartDate', startTime);
} else {
$(this).datetimepicker('setStartDate', null);
}
});