Returns the number of days in the given date.
function dateNumberOfDaysInMonth(date: Date): number
date:object
The date (year and month) to check.
The number of days in the given month.
import { dateNumberOfDaysInMonth } from 'utils/dates';
console.log(dateNumberOfDaysInMonth(new Date(2017, 7))); // Outputs: 31
console.log(dateNumberOfDaysInMonth(new Date(2017, 4))); // Outputs: 30