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
function getAllDatesOfMonth(date) { const mDate = moment(date, "YYYY-MM"); const daysCount = mDate.daysInMonth(); return Array(daysCount).fill(null).map((v,index)=>{ const addDays = index === 0 ? 0 : 1; return mDate.add(addDays, 'days').format('YYYY-MM-DD'); }); }