FIX: Posts should have auto updating dates

This commit is contained in:
Robin Ward 2016-02-11 15:17:58 -05:00
parent 1d54ba260a
commit 5693795dbf
1 changed files with 7 additions and 1 deletions

View File

@ -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));
}
}