开发者

DatePicker Problem

开发者 https://www.devze.com 2023-01-19 05:03 出处:网络
I have to set the startdate/Mindate in jquery datapicked calender. i am using datepicker 开发者_开发百科v1.7.2. and using mindate and max date prpperty but its not working fine.Try this code. In this

I have to set the startdate/Mindate in jquery datapicked calender. i am using datepicker 开发者_开发百科v1.7.2. and using mindate and max date prpperty but its not working fine.


Try this code. In this the end date is 1 day after start date.

$('#enddate').datepicker({
    dateFormat: "dd M yy",
    beforeShow: customRange,
    //Your other configurations.
    });

  function customRange(input) {
   if (input.id == "enddate")
    {
    dateMin = new Date();
    if ($("#startdate").datepicker("getDate") != null)
    {
    dateMin = $("#startdate").datepicker("getDate");
    dateMin.setDate(dateMin.getDate() + 1); //here we are adding 1 day to start date/
    }
    }
    return {
    minDate: dateMin
  }; 
}​
0

精彩评论

暂无评论...
验证码 换一张
取 消