mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
FIX: Posts should have auto updating dates
This commit is contained in:
parent
1d54ba260a
commit
5693795dbf
1 changed files with 7 additions and 1 deletions
|
@ -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 a new issue