diff --git a/components/Blog/BlogCard/__snapshots__/index.stories.tsx.snap b/components/Blog/BlogCard/__snapshots__/index.stories.tsx.snap index 3badfc810dc37..e19763764b8c1 100644 --- a/components/Blog/BlogCard/__snapshots__/index.stories.tsx.snap +++ b/components/Blog/BlogCard/__snapshots__/index.stories.tsx.snap @@ -19,7 +19,7 @@ exports[`Blog/BlogCard Default smoke-test 1`] = `

- April 21, 2023 + 21 April 2023

by diff --git a/components/Common/Time/index.tsx b/components/Common/Time/index.tsx new file mode 100644 index 0000000000000..1766b37cbef73 --- /dev/null +++ b/components/Common/Time/index.tsx @@ -0,0 +1,14 @@ +import type { FC } from 'react'; +import { FormattedDate } from 'react-intl'; + +type TimeProps = { date: string | Date; format: Intl.DateTimeFormatOptions }; + +export const Time: FC = ({ date, format }) => { + const dateObject = new Date(date); + + return ( + + ); +}; diff --git a/i18n/config.json b/i18n/config.json index 29dca9ed604b8..1b682d7654944 100644 --- a/i18n/config.json +++ b/i18n/config.json @@ -32,7 +32,7 @@ "name": "English", "langDir": "ltr", "dateFormat": "MM.DD.YYYY", - "hrefLang": "en-US", + "hrefLang": "en-GB", "enabled": true, "default": true }, diff --git a/layouts/BlogIndexLayout.tsx b/layouts/BlogIndexLayout.tsx index 300248b722aae..697c1cd328fce 100644 --- a/layouts/BlogIndexLayout.tsx +++ b/layouts/BlogIndexLayout.tsx @@ -1,6 +1,7 @@ import { useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; import BaseLayout from './BaseLayout'; +import { Time } from '../components/Common/Time'; import Pagination from '../components/Pagination'; import LocalizedLink from '../components/LocalizedLink'; import { useBlogData } from '../hooks/useBlogData'; @@ -39,13 +40,10 @@ const BlogIndexLayout: FC = ({ children }) => {

diff --git a/layouts/CategoryIndexLayout.tsx b/layouts/CategoryIndexLayout.tsx index b17bc063b2520..54d80aed0c342 100644 --- a/layouts/CategoryIndexLayout.tsx +++ b/layouts/CategoryIndexLayout.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react'; import BaseLayout from './BaseLayout'; +import { Time } from '../components/Common/Time'; import LocalizedLink from '../components/LocalizedLink'; import { useLayoutContext } from '../hooks/useLayoutContext'; import { useBlogData } from '../hooks/useBlogData'; @@ -23,13 +24,10 @@ const CategoryIndexLayout: FC = ({ children }) => {