日期控件开始和结束时间比较

添加bootstrap-datetimepicker日期控件的开始日期和结束日期之间的限制

//日期时间选择器
$("#datetimeStart").datetimepicker({
    format: "yyyy-mm-dd",
    autoclose: true,
    minView: "month",
    maxView: "decade",
    todayBtn: true,
    pickerPosition: "bottom-left"
}).on("click",function(ev){
    $("#datetimeStart").datetimepicker("setEndDate", $("#datetimeEnd").val());
});
$("#datetimeEnd").datetimepicker({
    format: "yyyy-mm-dd",
    autoclose: true,
    minView: "month",
    maxView: "decade",
    todayBtn: true,
    pickerPosition: "bottom-left"
}).on("click", function (ev) {
    $("#datetimeEnd").datetimepicker("setStartDate", $("#datetimeStart").val());
});

 

WdatePicker选择开始时间与结束时间

<input type="text" id="begin_date" name="begin_date"
              class="Wdate fixWidth"
              onfocus="WdatePicker({startDate:'%y',dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'end_date\')}'})">

<input type="text" id="end_date" name="end_date"
              class="Wdate fixWidth"
              onfocus="WdatePicker({startDate:'%y',dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'begin_date\')}'})">

  

你可能感兴趣的:(日期控件开始和结束时间比较)