const getDaysInMonth = (year, month) => {  
    let date = new Date(year, month, 1);  
    return new Date(date.getTime() - 864e5).getDate();  
} 

getDaysInMonth(2018,02)
// 28

  

相关文章:

  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
猜你喜欢
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-08-29
  • 2022-12-23
相关资源
相似解决方案