标签:new function min type length for r.js val calendar
var calendar2 = new datePicker();
calendar.init({
‘trigger‘: ‘#datetime-picker-start‘, /*选择器,触发弹出插件*/
‘type‘: ‘date‘,/*date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择*/
‘minDate‘:calculationDate(1),/*最小日期 1天*/
‘maxDate‘:calculationDate(30),/*最大日期*/
‘format‘: ‘yyyy-MM-dd 零时‘,
‘onClose‘: function () {/*取消时触发事件*/
if(this.value&&this.value.length>9){
var date=new Date(Date.parse(this.value.substr(0,10).replace(/-/g, "/")));
var startDate = new Date(Date.parse($("#datetime-picker-start").val().substr(0,10).replace(/-/g, "/")));
var endDate = new Date(Date.parse($("#datetime-picker-end").val().substr(0,10).replace(/-/g, "/")));
if(!isNaN(endDate)){
$("#datetime-picker-end").val();
}
if(!isNaN(startDate)){
// calendar1.init({
// ‘minDate‘:calculationDateByStartDate(1,startDate),/*最小日期 1天*/
// ‘maxDate‘:calculationDateYearByStartDate(1,startDate),/*最大日期 1年*/
// })
calendar1.init({
‘trigger‘: ‘#datetime-picker-end‘, /*选择器,触发弹出插件*/
‘type‘: ‘date‘,/*date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择*/
‘minDate‘:calculationDateByStartDate(1, startDate),/*最小日期 1天*/
‘maxDate‘:calculationDateYearByStartDate(1, startDate),/*最大日期 1年*/
‘format‘: ‘yyyy-MM-dd 24时‘,
‘onClose‘: function () {/*取消时触发事件*/
if(this.value&&this.value.length>9){
// var date=new Date(Date.parse(this.value.substr(0,10).replace(/-/g, "/")));
setEndTime();
}
}
});
// calculationDateByStartDate(1, startDate);
// calculationDateYearByStartDate(1, startDate);
}
// setEndTime();
}
}
});
标签:new function min type length for r.js val calendar
原文地址:https://www.cnblogs.com/billking/p/9055300.html