Получите количество дней за месяц JavaScript

function getDaysInMonth(year, month) {
  return new Date(year, month, 0).getDate();
}
kid amogus