]> cat aescling's git repositories - mastodon.git/commitdiff
Fix dates (without time) being rendered as datetimes in public pages (#13034)
authorThibG <thib@sitedethib.com>
Mon, 3 Feb 2020 16:48:56 +0000 (17:48 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Feb 2020 16:48:56 +0000 (17:48 +0100)
app/javascript/packs/public.js

index 9bc6214af28b2b08832cc7f85d834f3597624002..2fb9cb29d8600d1f12790f0a6f8c70907f2291e9 100644 (file)
@@ -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]');