momentJS date string add 5 days

前端 未结 9 1832
死守一世寂寞
死守一世寂寞 2020-12-23 09:03

i have a start date string \"20.03.2014\" and i want to add 5 days to this with moment.js but i don\'t get the new date \"25.03.2014\" in the alert window.

here my j

9条回答
  •  借酒劲吻你
    2020-12-23 09:09

    1. add https://momentjs.com/downloads/moment-with-locales.js to your html page
    2. var todayDate = moment().format('DD-MM-YYYY');//to get today date 06/03/2018 if you want to add extra day to your current date then
    3. var dueDate = moment().add(15,'days').format('DD-MM-YYYY')// to add 15 days to current date..

    point 2 and 3 are using in your jquery code...

提交回复
热议问题