Is there any efficient way of getting the number of days in current month using JavaScript ?
Asked
Active
Viewed 3,394 times
1 Answers
1
function _getDates(year, month) {
return new Date(year, month, 0).getDate(); // 0 + number of days
}
console.log(_getDates(2016, 07))

brk
- 48,835
- 10
- 56
- 78
-
1I used https://jsfiddle.net/mf543zh6/ It is not running though – psyborg.eth Jul 30 '16 at 09:05