function getDaysOfMonth(year, month) {
        month = parseInt(month);
        switch (month) {
              case 1:
              case 3:
              case 5:
              case 7:
              case 8:
              case 10:
              case 12:
                  return 31;
              case 4:
              case 6:
              case 9:
              case 11:
                   return 30;
              case 2:
                   return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ? 29 : 28;
              default:
                   return 0;
      }
};

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案