显示年月日:
开始时间:
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
结束时间:
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
样例截图:
显示年月:
<input type="text" autocomplete="off" class="time-input" id="month" placeholder="开始时间" data-format="yyyy-MM" data-type="month" required style="width:200px;"/>
样例截图:
[图片]
重置功能并初始化到当前日期:
- $.form.reset();
var date = new Date();
var month = parseInt(date.getMonth() + 1)
var day = date.getDate()
if (month < 10) month = '0' month
if (day < 10) day = '0' day
$("#endTime").val(date.getFullYear() + '-' month + '-' day);
$("#startTime").val(date.getFullYear() + '-' month + '-' day);
startLayDate.config.max.year = date.getFullYear();
startLayDate.config.max.month = date.getMonth() ;
startLayDate.config.max.date = date.getDate();
endLayDate.config.min.year = date.getFullYear();
endLayDate.config.min.month = date.getMonth() ;
endLayDate.config.min.date = date.getDate();
console.log("startLayDate",startLayDate,startLayDate.config)
四、注意事项:
开始日期小于结束日期