Fix dates (without time) being rendered as datetimes in public pages (#13034)

main
ThibG 2020-02-03 17:48:56 +01:00 committed by GitHub
parent 5265df0a8a
commit c31d61d7f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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]');