views:

29

answers:

1

How to disable month end Days like 30,31, 28(feb), 29 feb(leep year)? in js calender

A: 

To check if a date should be included, create a Date object from the components, then check if it contains the expected day. If the date doesn't exist, for example 2010-02-31, it will become the corresponding date in the next month, i.e. 2010-03-03.

Example:

function checkIfDayExists(year, month, day) {
  var d = new Date(year, month - 1, day);
  return d.getDay == day;
}
Guffa
I just looked at the demos the OP provided, but it already does that; e.g., see http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerDefaultToday.html
Marcel Korpel
me also disable week end days, it is also avail at the above link, but month end is not working.
Aamir
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerCustomCellRender.htmlhere code avail for disable week end
Aamir