[Glitch] Fix dates (without time) being rendered as datetimes in public pages

Port f7deab10a5 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
th-downstream
ThibG 5 years ago committed by Thibaut Girka
parent 0c266be79b
commit d0a1423daf

@ -62,7 +62,7 @@ function main() {
content.textContent = timeAgoString({
formatMessage: ({ id, defaultMessage }, values) => (new IntlMessageFormat(messages[id] || defaultMessage, locale)).format(values),
formatDate: (date, options) => (new Intl.DateTimeFormat(locale, options)).format(date),
}, datetime, now, now.getFullYear());
}, datetime, now, now.getFullYear(), content.getAttribute('datetime').includes('T'));
});
const reactComponents = document.querySelectorAll('[data-component]');

Loading…
Cancel
Save