Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#9229 closed bug (notabug)

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.

Change History (2)

comment:1 Changed 6 years ago by Scott González

Resolution: notabug
Status: newclosed

new Date("30-3-2013") isn't valid. You want new Date("3-30-2013")

comment:2 Changed 6 years ago by hwong

Thank You so much.

Note: See TracTickets for help on using tickets.