Every month in calendar could have max 28, 29, 30 and 31 days.
We are able to get utilizing native JS date.
let days = new Date(2022, 8, 0).getDate();
console.log(days);
> 31 // days in August
First day in every month can begin from any day.
let startingDay = new Date(2022, 8).getDay();
console.log(startingDay);
> 4 // represents Thursday
For extra date utils, you may refer: DateUtils
Additionally, comply with for updates: https://twitter.com/urstrulyvishwak