Reputation: 3935
I would like to know how can we fetch the Last day of the current month using javascript. E.g. last day of January is Tuesday
Upvotes: 0
Views: 7344
Reputation:
var today = new Date()
, lastOfMonth = new Date( today.getFullYear(), today.getMonth()+1, 0 )
, dayOfWeek = lastOfMonth.getDay();
dayOfWeek
now = 0 for sunday... 6 for saturday
Upvotes: 1