mirror of
https://github.com/discourse/discourse.git
synced 2025-10-03 17:21:20 +08:00
8 lines
270 B
JavaScript
8 lines
270 B
JavaScript
import { htmlSafe } from "@ember/template";
|
|
import guessDateFormat from "../lib/guess-best-date-format";
|
|
|
|
export default function (date) {
|
|
date = moment.utc(date).tz(moment.tz.guess());
|
|
const format = guessDateFormat(date);
|
|
return htmlSafe(date.format(format));
|
|
}
|