idealdear / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

Setting the endDate #300

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In some cases, we need to limit the dates that users can select.

I wonder how to set the endDate to be two months later, which means users can 
only select dates in the current month, and the next two months.

I am not sure if the following code will resolve it, as it does not consider 
the actual scenario(November+2?)

d = new Date(); 
c = d.getFullYear()+"/"+(d.getMonth()+3)+"/"+d.getDate();
endDate:c

Thank you

Original issue reported on code.google.com by jieer...@gmail.com on 12 Aug 2011 at 3:09

GoogleCodeExporter commented 8 years ago
There are examples on the site but try something like

endDate: (new Date()).addMonths(2)

Original comment by kelvin.l...@gmail.com on 12 Aug 2011 at 10:15