Search and Top Navigation
#9229 closed bug (notabug)
Opened April 12, 2013 11:20PM UTC
Closed April 12, 2013 11:40PM UTC
Last modified April 13, 2013 04:10AM UTC
datepicker minDate and maxDate with new Date(...) does not behave the same as with "+12d"
Reported by: | hwong | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Sample code:
$("#thisWorks").datepicker({ dateFormat: "DD, MM d, yy", minDate: "-14d", maxDate: "+90d" }); $("#thisDontWork").datepicker({ dateFormat: "DD, MM d, yy", minDate: new Date("30-3-2013"), maxDate: new Date("13-7-2013") });
When using minDate: "-14d" and maxDate: "+90d", the user cannot move the month past the min and max date. (e.g. if min date is 1st March 2013, user cannot even move using the arrows to Feb)
However, it is not the same when setting the min/maxDate using a Date object. In this case, the user can move beyond the min/maxDate.
These behaviors are inconsistent. Please fix.
new Date("30-3-2013")
isn't valid. You wantnew Date("3-30-2013")