mirror of
https://github.com/knadh/listmonk.git
synced 2025-01-01 11:45:01 +08:00
Fix incorrect 'nice date' formatting. Closes #635.
This commit is contained in:
parent
e982e6bb25
commit
b48a15cfa3
1 changed files with 5 additions and 6 deletions
|
@ -32,13 +32,12 @@ export default class Utils {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
const d = new Date(stamp);
|
const d = dayjs(stamp);
|
||||||
const day = this.i18n.t(`globals.days.${(d.getDay())}`);
|
const day = this.i18n.t(`globals.days.${d.day()}`);
|
||||||
const month = this.i18n.t(`globals.months.${(d.getMonth() + 1)}`);
|
const month = this.i18n.t(`globals.months.${d.month() + 1}`);
|
||||||
let out = `${day}, ${d.getDate()}`;
|
let out = d.format(`[${day},] DD [${month}] YYYY`);
|
||||||
out += ` ${month} ${d.getFullYear()}`;
|
|
||||||
if (showTime) {
|
if (showTime) {
|
||||||
out += ` ${d.getHours()}:${d.getMinutes()}`;
|
out += d.format(', HH:mm');
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
Loading…
Reference in a new issue