From: ThibG Date: Mon, 3 Feb 2020 16:48:56 +0000 (+0100) Subject: Fix dates (without time) being rendered as datetimes in public pages (#13034) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=c31d61d7f2d576b42ea82ab01470bce7e6e5a3a7;p=mastodon.git Fix dates (without time) being rendered as datetimes in public pages (#13034) --- diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 9bc6214af..2fb9cb29d 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]');