This method displays the time difference to given reference time and the Calendar time.
moment().calendar(); moment().calendar(referenceTime); moment().calendar(referenceTime, formats);
var changeddate = moment().calendar();
We have discussed chaining method in earlier chapter, so we can use the add/subtract methods with moment to get the calendar value as shown below −
var changeddate = moment().add(24, 'h').calendar();
var changeddate = moment().subtract(24, 'h').calendar();