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/app/helpers/inline-date.js
2020-12-01 15:31:26 -03:00

11 lines
292 B
JavaScript

import { registerHelper } from "discourse-common/lib/helpers";
import { relativeAge } from "discourse/lib/formatter";
registerHelper("inline-date", function ([dt]) {
// TODO: Remove this in 1.13 or greater
if (dt.value) {
dt = dt.value();
}
return relativeAge(new Date(dt));
});