How to add weeks to date using javascript?

前端 未结 8 805
轻奢々
轻奢々 2020-12-29 18:32

Javascript definitely isn\'t my strongest point. I\'ve been attempting this for a couple of hours now and seem to be getting stuck with date formatting somewhere.

I

8条回答
  •  鱼传尺愫
    2020-12-29 19:10

    var d = new Date("2019-08-01");
    d.setDate(d.getDate()+parseInt(7));
    

    here 7 is the days which you want to add in the date

提交回复
热议问题