moment js set days code example
Example 1: moment subtract days
var startdate = moment();
startdate = startdate.subtract(1, "days");
startdate = startdate.format("DD-MM-YYYY");
Example 2: moment add 30 days
moment().add(30, 'days');
Example 3: format a date moment
moment(testDate).format('MM/DD/YYYY');
Example 4: moment format heure
var time = "15:30:00";
var formatted = moment(time, "HH:mm:ss").format("LT");
console.log(formatted);
//it will return 3:30 PM