mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
refactor(v2): i18n cleanups / refactors (#4405)
* chore: fix various intl stuff - remove intl-locales-supported & intl since they're deprecated and only needed for IE11 - add new polyfills for node 12 - clean up babel intl extractor - reset jest test timezone to UTC so it passes even for East Coast contributor * chore: change build to include Node 14 * docs: update i18n reqs
This commit is contained in:
parent
c3968e2d8f
commit
1078341b22
15 changed files with 162 additions and 124 deletions
|
@ -26,7 +26,6 @@ import {
|
|||
getEditUrl,
|
||||
getFolderContainingFile,
|
||||
posixPath,
|
||||
getDateTimeFormat,
|
||||
} from '@docusaurus/utils';
|
||||
import {LoadContext} from '@docusaurus/types';
|
||||
import {replaceMarkdownLinks} from '@docusaurus/utils/lib/markdownLinks';
|
||||
|
@ -177,14 +176,11 @@ export async function generateBlogPosts(
|
|||
|
||||
// Use file create time for blog.
|
||||
date = date || (await fs.stat(source)).birthtime;
|
||||
const formattedDate = getDateTimeFormat(i18n.currentLocale)(
|
||||
i18n.currentLocale,
|
||||
{
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
},
|
||||
).format(date);
|
||||
const formattedDate = new Intl.DateTimeFormat(i18n.currentLocale, {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
}).format(date);
|
||||
|
||||
const slug =
|
||||
frontMatter.slug || (match ? toUrl({date, link: linkName}) : linkName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue