add number of days base on month javascript code example
Example: daysinmonth javascript
var dt = new Date();
var month = dt.getMonth();
var year = dt.getFullYear();
daysInMonth = new Date(year, month, 0).getDate();
var dt = new Date();
var month = dt.getMonth();
var year = dt.getFullYear();
daysInMonth = new Date(year, month, 0).getDate();