In moment, with calendar, I can customize how to show the time like below
moment(dateTime).calendar(null, {
sameDay: '[Today]',
nextDay: '[Tomorrow]',
nextWeek: 'dddd',
lastDay: '[Yesterday]',
lastWeek: '[Last] dddd',
sameElse: 'DD/MM/YYYY'
});
In date-fns, based on the formatRelative, I can provide options.
formatRelative(dateTime, Date.now(), options);
However, after reading options document, I still cannot figure out how to customize it.
Any guide will be helpful. Thanks