[removed] calculate number of days in month for a given year

前端 未结 8 1880
一个人的身影
一个人的身影 2020-12-05 12:12

I have a HTML page with 3 dropdowns for the month, day and year and I was wondering if there was a way to populate the month drop down properly depending on the month and ye

8条回答
  •  攒了一身酷
    2020-12-05 12:24

    You can actually use this:

    var curdate = new Date(); DaysMonth = 32 - new Date(curdate.getYear(), curdate.getMonth(), 32).getDate();

    ;)

提交回复
热议问题