Probleme zu haben Tagen Moment js Objekte hinzufügen:hinzufügen Tagen mit Moment JS
Ich verwende diesen Code:
var contractMoment = this.moment(contract,'DD/MM/YYYY')
var start = contractMoment;
var end = contractMoment;
start = contractMoment.add(19, 'days');
end = contractMoment.add(51, 'days');
contractMoment, bevor ich wie folgt aussieht hinzu:
Thu Dec 02 2004 00:00:00 GMT-0600 (Central Standard Time)
und nachdem ich das Hinzufügen und Konsolenprotokoll Anfang und Ende zu tun, hier ist das, was ich bekomme:
Thu Dec 02 2004 00:00:00 GMT-0600 (Central Standard Time)
Es gibt einen Moment Objekt für jeden, was ich hier fehlt? ist das hinzugefügte Datum irgendwo im Momentobjekt vergraben?
+1, als zusätzliche Note, die Sie auch [ 'clone()'] (https://momentjs.com/docs/#/parsing/moment-clone/) Methode verwendet werden kann. – VincenzoC