I need to format some days in the format "Yesterday 17th May 2015" using moment.js. This is what I have so far:
var asd = moment(moment.utc("2015-09-30T08:35:40.59"))
.subtract(1, 'days')
.calendar();
I need to format some days in the format "Yesterday 17th May 2015" using moment.js. This is what I have so far:
var asd = moment(moment.utc("2015-09-30T08:35:40.59"))
.subtract(1, 'days')
.calendar();
Copyright © 2021 Jogjafile Inc.
As described in the Calendar customization doc is it possibile to customize the format of calendar.
In the example below, I customized the
sameElseformat ofcalendarfor the English locale to return a string with the format you required: