You can define custom locale strings.
moment.locale('en', {
relativeTime : {
future: "in %s",
past: "%s ago",
s: "seconds",
m: "a minute",
mm: "%d 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"
}
});
If you need additional processing, you can set the token as a function, as shown below, the function should return a string.
function (number, withoutSuffix, key, isFuture) {
return string;
}
source
share