- I am trying to display relative time in moment using the moment(...).fromNow()
- I am using the @nuxtjs/moment module
- It currently displays relative time as "15 days ago" etc. I want to change that to "15 d"
As per THIS answer is how it can be done currently
moment.updateLocale('en', {
relativeTime : {
future: "in %s",
past: "%s ago",
s: function (number, withoutSuffix, key, isFuture){
return '00:' + (number<10 ? '0':'') + number + ' minutes';
},
m: "01:00 minutes",
mm: function (number, withoutSuffix, key, isFuture){
return (number<10 ? '0':'') + number + ':00' + ' minutes';
},
h: "an hour",
hh: "%d hours",
d: "a day",
dd: "%d days",
M: "a month",
MM: "%d months",
y: "a year",
yy: "%d years"
}
});
How do I apply this to the @nuxtjs/moment module