Skip to main content
Addeded code snippet so people could see live answer and test compatibility.
Source Link

If you can, use moment.js. JavaScript doesn't have very good native date/time methods. The following is an example Moment's syntax:

var nextWeek = moment().add(7, 'days'); 

var nextWeek = moment().add(7, 'days'); alert(nextWeek);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js"></script>

Reference: http://momentjs.com/docs/#/manipulating/add/

If you can, use moment.js. JavaScript doesn't have very good native date/time methods. The following is an example Moment's syntax:

var nextWeek = moment().add(7, 'days'); 

Reference: http://momentjs.com/docs/#/manipulating/add/

If you can, use moment.js. JavaScript doesn't have very good native date/time methods. The following is an example Moment's syntax:

var nextWeek = moment().add(7, 'days'); alert(nextWeek);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment-with-locales.min.js"></script>

Reference: http://momentjs.com/docs/#/manipulating/add/

Add example, move links around.
Source Link
ThisClark
  • 14.9k
  • 11
  • 73
  • 103

If you can, use moment.jsmoment.js. JavaScript doesn't have very good native date/time methods. The following is an example Moment's syntax:

var nextWeek = moment().add(7, 'days'); 

Reference: http://momentjs.com/docs/#/manipulating/add/

If you can, use moment.js. JavaScript doesn't have very good native date/time methods. http://momentjs.com/docs/#/manipulating/add/

If you can, use moment.js. JavaScript doesn't have very good native date/time methods. The following is an example Moment's syntax:

var nextWeek = moment().add(7, 'days'); 

Reference: http://momentjs.com/docs/#/manipulating/add/

Source Link
user2910265
  • 894
  • 1
  • 10
  • 15

If you can, use moment.js. JavaScript doesn't have very good native date/time methods. http://momentjs.com/docs/#/manipulating/add/