This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/helpers/inline-date.js
2020-03-12 13:29:55 -04:00

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