0

I am developing an events calendar application. Based on the current date, I got 50 months, and now I want to get the weeks of each of those months. Can anyone help me?

My rows array contains the list of months.

for(let i = 0; i <= pastScrollRange + futureScrollRange; i++){
    const rangeDate = date.clone().addMonths(i - pastScrollRange, true);
    const rangeDateStr = rangeDate.toString('MMMM yyyy');
    
    if((pastScrollRange - 1 <= i && i <= pastScrollRange+1) || (!pastScrollRange && i <= pastScrollRange+2)){
        rows.push(rangeDate)
    }else{
        rows.push(rangeDateStr)
    }
}
HaiAnh
  • 3
  • 3

0 Answers0