mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 00:23:38 +08:00
FIX: Posts should have auto updating dates
This commit is contained in:
parent
1d54ba260a
commit
5693795dbf
|
@ -5,7 +5,13 @@ import { number } from 'discourse/lib/formatter';
|
|||
export function dateNode(dt) {
|
||||
if (typeof dt === "string") { dt = new Date(dt); }
|
||||
if (dt) {
|
||||
return h('span', { attributes: { title: longDate(dt) } }, relativeAge(dt));
|
||||
const attributes = {
|
||||
title: longDate(dt),
|
||||
'data-time': dt.getTime(),
|
||||
'data-format': 'tiny'
|
||||
};
|
||||
|
||||
return h('span.relative-date', { attributes }, relativeAge(dt));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user