2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00
discourse/plugins/discourse-calendar/assets/javascripts/discourse/helpers/format-future-date.js
2025-07-15 16:38:05 +02:00

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