“Moment bekommen Monat Tag” Code-Antworten

Moment js bekommt Datum 1 Monat

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);
Confused Cow

Moment bekommen Monat Tag

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

date.date() === 25;
GutoTrosla

Ähnliche Antworten wie “Moment bekommen Monat Tag”

Fragen ähnlich wie “Moment bekommen Monat Tag”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen