]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix dates (without time) being rendered as datetimes in public pages
authorThibG <thib@sitedethib.com>
Mon, 3 Feb 2020 16:48:56 +0000 (17:48 +0100)
committerThibaut Girka <thib@sitedethib.com>
Thu, 6 Feb 2020 20:41:50 +0000 (21:41 +0100)
Port c31d61d7f2d576b42ea82ab01470bce7e6e5a3a7 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/packs/public.js

index d1adfb17af9b66dad44f34b7086e5d59343deed7..d8a97704f4b6eb2cf080761caccf3fe9061a10b0 100644 (file)
@@ -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]');