Allow localization of month-day format string
The short month-day format ex: 'Aug 8', is not built-in to momentjs, so we need to localize it. // FREEBIE
This commit is contained in:
parent
93edce87aa
commit
9ab64ec44d
2 changed files with 9 additions and 5 deletions
|
@ -53,7 +53,7 @@
|
|||
return timestamp.format(this._format.y);
|
||||
} else if (timediff.months() > 0 || timediff.days() > 6) {
|
||||
this.delay = null;
|
||||
return timestamp.format(this._format.mo);
|
||||
return timestamp.format(this._format.M);
|
||||
} else if (timediff.days() > 0) {
|
||||
this.delay = moment(timestamp).add(timediff.days() + 1,'d').diff(moment());
|
||||
return timestamp.format(this._format.d);
|
||||
|
@ -78,8 +78,8 @@
|
|||
return moment.duration(number, string).humanize();
|
||||
},
|
||||
_format: {
|
||||
y: "MMM D, YYYY",
|
||||
mo: "MMM D",
|
||||
y: "ll",
|
||||
M: i18n('timestampFormat_M') || "MMM D",
|
||||
d: "ddd"
|
||||
}
|
||||
});
|
||||
|
@ -88,8 +88,8 @@
|
|||
return moment.duration(-1 * number, string).humanize(string !== 's');
|
||||
},
|
||||
_format: {
|
||||
y: "MMM D, YYYY LT",
|
||||
mo: "MMM D LT",
|
||||
y: "lll",
|
||||
M: (i18n('timestampFormat_M') || "MMM D") + ' LT',
|
||||
d: "ddd LT"
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue