mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
[Glitch] Fix dates (without time) being rendered as datetimes in public pages
Port c31d61d7f2d576b42ea82ab01470bce7e6e5a3a7 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
parent
b9aa57d5bf
commit
fe9a124f5a
@ -62,7 +62,7 @@ function main() {
|
|||||||
content.textContent = timeAgoString({
|
content.textContent = timeAgoString({
|
||||||
formatMessage: ({ id, defaultMessage }, values) => (new IntlMessageFormat(messages[id] || defaultMessage, locale)).format(values),
|
formatMessage: ({ id, defaultMessage }, values) => (new IntlMessageFormat(messages[id] || defaultMessage, locale)).format(values),
|
||||||
formatDate: (date, options) => (new Intl.DateTimeFormat(locale, options)).format(date),
|
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]');
|
const reactComponents = document.querySelectorAll('[data-component]');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user