mrandersson/moment — comment on commit 455bf946af62057f9ad1e37fc79b8ee62b1f0e2a
File:  line 0
By timrwood:

Fair enough. Although its a little shorter to use month and date overloading.

moment.fn.daysInMonth = function() {
// clone the date
// set it to next month
// set the date to zero (will be one day before next months first day)
// return the new date
return this.clone().month(this.month() + 1).date(0).date();
}

I'll add this and some unit tests for it.