How to get list of days in a month with Moment.js

后端 未结 11 637
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 07:17

Using Moment.js I would like to get all days in a month of specific year in an array. For example:

January-2014:
[
\"01-wed\",
\"02-thr\",
\"03-fri\",
\"04-s         


        
11条回答
  •  清歌不尽
    2020-12-14 08:06

    you can do it using for loop with moment

    var daysInMonth = [];
    
     var monthDate = moment().startOf('month'); 
    
     for(let i=0;i

提交回复
热议问题