mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
feat: allow setting calendar for i18n date formatting (#6430)
* feat: allow setting calendar for i18n date formatting * fix TS * add test
This commit is contained in:
parent
3e110054d7
commit
7941a46be3
9 changed files with 54 additions and 12 deletions
|
@ -254,9 +254,9 @@ function doProcessDocMetadata({
|
|||
lastUpdatedBy: lastUpdate.lastUpdatedBy,
|
||||
lastUpdatedAt: lastUpdate.lastUpdatedAt,
|
||||
formattedLastUpdatedAt: lastUpdate.lastUpdatedAt
|
||||
? new Intl.DateTimeFormat(i18n.currentLocale).format(
|
||||
lastUpdate.lastUpdatedAt * 1000,
|
||||
)
|
||||
? new Intl.DateTimeFormat(i18n.currentLocale, {
|
||||
calendar: i18n.localeConfigs[i18n.currentLocale]!.calendar,
|
||||
}).format(lastUpdate.lastUpdatedAt * 1000)
|
||||
: undefined,
|
||||
sidebarPosition,
|
||||
frontMatter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue