mirror of
https://github.com/discourse/discourse.git
synced 2025-02-03 20:56:16 +08:00
11 lines
291 B
JavaScript
11 lines
291 B
JavaScript
import { relativeAge } from "discourse/lib/formatter";
|
|
import { registerHelper } from "discourse-common/lib/helpers";
|
|
|
|
registerHelper("inline-date", function([dt]) {
|
|
// TODO: Remove this in 1.13 or greater
|
|
if (dt.value) {
|
|
dt = dt.value();
|
|
}
|
|
return relativeAge(new Date(dt));
|
|
});
|