From f7deab10a5fac09928ed208690cc6358dc0d67b6 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 3 Feb 2020 17:48:56 +0100 Subject: [PATCH] Fix dates (without time) being rendered as datetimes in public pages (#13034) --- app/javascript/packs/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 9bc6214af2..2fb9cb29d8 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -82,7 +82,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]');