Answers for "moment add month"

2

moment add 30 days

moment().add(30, 'days');
Posted by: Guest on December-22-2020
6

moment js add day

var new_date = moment(startdate, "DD-MM-YYYY").add(5, 'days');
Posted by: Guest on May-15-2020
2

moment add seconds

var travelTime = moment().add(642, 'seconds').format('hh:mm A');// it will add 642 seconds in the current time and will give time in 03:35 PM format

var travelTime = moment().add(11, 'minutes').format('hh:mm A');// it will add 11 mins in the current time and will give time in 03:35 PM format; can use m or minutes 

var travelTime = moment().add(2, 'hours').format('hh:mm A');// it will add 2 hours in the current time and will give time in 03:35 PM format
Posted by: Guest on March-03-2020
1

moment add 6 months

moment().add(6, 'M');
Posted by: Guest on May-01-2021
0

moment js get date 1 month

var currentDate = moment('2015-10-30');
var futureMonth = moment(currentDate).add(1, 'M');
var futureMonthEnd = moment(futureMonth).endOf('month');

if(currentDate.date() != futureMonth.date() && futureMonth.isSame(futureMonthEnd.format('YYYY-MM-DD'))) {
    futureMonth = futureMonth.add(1, 'd');
}

console.log(currentDate);
console.log(futureMonth);
Posted by: Guest on April-21-2020
2

moment get month day

//The correct function to use is .date():

date.date() === 25;
Posted by: Guest on January-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language