You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiongetDateNum(params){lettemp=null;letgetYear=params.getFullYear();letgetMonth=params.getMonth()+1;// new Date(year, month, 0).getDate()temp=newDate(getYear,getMonth,0).getDate();returntemp;}console.log('结果:',getDateNum(newDate()));
Activity
githubzml commentedon Apr 21, 2021
ghost commentedon Apr 21, 2021
yxj1028530975 commentedon Apr 22, 2021
function getDateDays(year,month){ return new Date(year,month,0).getDate()//获得是标准时间,需要getDate()获得天数 } getDateDays(2021,5) // =>31
alanhe421 commentedon Apr 22, 2021