I read the documentation of the .js moment that if you want to add 1 month from the current date, you use this code
var moment = require('moment'); var futureMonth = moment().add(1, 'M').format('DD-MM-YYYY');
But the problem is right now, it is incorrectly adding the date correctly, for example, let's say the current date is 10/31/2015, explain in the code
var currentDate = moment().format('DD-MM-YYYY'); var futureMonth = moment().add(1, 'M').format('DD-MM-YYYY'); console.log(currentDate)
if you look at the current calendar time, 1 month from 31/10/2015 supposedly 1/12/2015
Can someone give me some opinion on how to fix this problem.
thanks
source share