From 0f5411b7999cfc737aa281f17112d96bbfaa0373 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 3 Feb 2020 17:48:56 +0100 Subject: [Glitch] Fix dates (without time) being rendered as datetimes in public pages Port c31d61d7f2d576b42ea82ab01470bce7e6e5a3a7 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/packs/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours') diff --git a/app/javascript/flavours/glitch/packs/public.js b/app/javascript/flavours/glitch/packs/public.js index da0b4c8e0..c2a1d9d62 100644 --- a/app/javascript/flavours/glitch/packs/public.js +++ b/app/javascript/flavours/glitch/packs/public.js @@ -54,7 +54,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]'); -- cgit