How to get next seven days from X and format in JS

前端 未结 6 2223
渐次进展
渐次进展 2020-12-06 19:25

I want to print something like this (a 7-day calendar) but with the ability to start from any date I want.

Monday, 1 January 2011
Tuesday, 2 January 2011
Wed         


        
6条回答
  •  天命终不由人
    2020-12-06 20:22

    var feb22 = new Date(2012, 1, 22);
    var feb23 = new Date(feb22.getTime() + 1000*60*60*24);
    

    ...and so on

提交回复
热议问题