I am making a kalendar (date picker) and I was wondering how I can retrieve the number of days in the month. I can't go and declare the number of days for every month, thats too much code and not very effecient. thanx in advance, Zynex
This was not originally mine but I have been using it for years but can't remember the original author. Anyways here it is: function getDaysInMonth(year, month) { // month: 0 = Jan, 11 = Dec return 32 - new Date(year, month, 32).getDate(); } Code (markup):