function getDaysOfMonth(month, year) {
var _year = year || new Date().getFullYear();
return new Date(_year, month).getDate();
}
getDaysOfMonth(2); // Feb, 2016 -> 29 days
getDaysOfMonth(2, 2017) // Feb, 2017 -> 28 days
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.