瀏覽代碼

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

master^2
ThibG 4 年之前
committed by GitHub
父節點
當前提交
c31d61d7f2
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      app/javascript/packs/public.js

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


Loading…
取消
儲存