diff --git a/src/app/[lng]/mypage/MypageTable.tsx b/src/app/[lng]/mypage/MypageTable.tsx index b0b6699d..7da5cd81 100644 --- a/src/app/[lng]/mypage/MypageTable.tsx +++ b/src/app/[lng]/mypage/MypageTable.tsx @@ -64,7 +64,7 @@ const MypageTable = async ({
- {dayjs(articleObj.createdAt).format('YYYY-MM-DD')} + {dayjs(articleObj.createdAt).tz().format('YYYY-MM-DD')}
diff --git a/src/app/[lng]/notice/[id]/AdditionalNotices.tsx b/src/app/[lng]/notice/[id]/AdditionalNotices.tsx index 20266f64..4bd61a9c 100644 --- a/src/app/[lng]/notice/[id]/AdditionalNotices.tsx +++ b/src/app/[lng]/notice/[id]/AdditionalNotices.tsx @@ -31,26 +31,29 @@ const AdditionalNotices = async ({ {t('zabo.additionalNotices.title')}

- {dayjs(content.createdAt).format('LLL')} + {dayjs(content.createdAt).tz().format('LLL')}

{index > 0 && - dayjs(content.deadline).format('LLL') !== - dayjs(localeContents[index - 1].deadline).format('LLL') && ( + !dayjs(content.deadline).isSame( + dayjs(localeContents[index - 1].deadline), + ) && (

{t('zabo.additionalNotices.deadlineChanged')}

- {dayjs(localeContents[index - 1].deadline).format('LLL')} + {dayjs(localeContents[index - 1].deadline) + .tz() + .format('LLL')}

- {dayjs(content.deadline).format('LLL')} + {dayjs(content.deadline).tz().format('LLL')}

)} diff --git a/src/app/[lng]/notice/[id]/NoticeInfo.tsx b/src/app/[lng]/notice/[id]/NoticeInfo.tsx index 1d52fccd..1b3e5c4e 100644 --- a/src/app/[lng]/notice/[id]/NoticeInfo.tsx +++ b/src/app/[lng]/notice/[id]/NoticeInfo.tsx @@ -27,7 +27,7 @@ const NoticeInfo = async ({
{deadline && ( <> - +
)} @@ -79,7 +79,7 @@ const Metadata = ({
- createdAt {{ createdAt: createdAt.format('LLL') }} + createdAt {{ createdAt: createdAt.tz().format('LLL') }} {' · '} diff --git a/src/app/components/molecules/DDay/DDay.tsx b/src/app/components/molecules/DDay/DDay.tsx index ff2a5726..de03fbfe 100644 --- a/src/app/components/molecules/DDay/DDay.tsx +++ b/src/app/components/molecules/DDay/DDay.tsx @@ -16,7 +16,7 @@ const DDay = ({ deadline, t, className }: PropsWithT) => ( ].join(' ')} >
- {ddayFormatted(dayjs(deadline), t)} + {ddayFormatted(dayjs(deadline).tz(), t)}
); diff --git a/src/app/components/organisms/Zabo/ImageZabo.tsx b/src/app/components/organisms/Zabo/ImageZabo.tsx index 5a237f3f..bcbb9fea 100644 --- a/src/app/components/organisms/Zabo/ImageZabo.tsx +++ b/src/app/components/organisms/Zabo/ImageZabo.tsx @@ -3,7 +3,6 @@ import { Trans } from 'react-i18next'; import ZaboImage from '@/app/components/molecules/ZaboImage'; import { PropsWithLng } from '@/app/i18next'; -import { useTranslation } from '@/app/i18next/client'; import getLocaleContents from '@/utils/getLocaleContents'; import DDay from '../../molecules/DDay'; @@ -21,8 +20,6 @@ const ImageZabo = ({ height, lng, }: ImageZaboProps & PropsWithLng) => { - const { i18n } = useTranslation(lng); - const localContents = getLocaleContents(contents, lng); const deadline = rawDeadline ? dayjs(rawDeadline) : undefined; @@ -59,7 +56,7 @@ const ImageZabo = ({
- {{ date: dayjs(createdAt).format('L') }} + {{ date: dayjs(createdAt).tz().format('L') }} · {{ views }}
diff --git a/src/app/components/organisms/Zabo/TextZabo.tsx b/src/app/components/organisms/Zabo/TextZabo.tsx index f79ef935..a7bb6b70 100644 --- a/src/app/components/organisms/Zabo/TextZabo.tsx +++ b/src/app/components/organisms/Zabo/TextZabo.tsx @@ -2,7 +2,6 @@ import dayjs from 'dayjs'; import { Trans } from 'react-i18next'; import { PropsWithLng } from '@/app/i18next'; -import { useTranslation } from '@/app/i18next/client'; import getLocaleContents from '@/utils/getLocaleContents'; import DDay from '../../molecules/DDay'; @@ -66,7 +65,7 @@ const TextZabo = ({
- {{ date: dayjs(createdAt).format('L') }} + {{ date: dayjs(createdAt).tz().format('L') }} · {{ views }}
diff --git a/src/app/components/templates/ResultZabo/ResultImageZabo.tsx b/src/app/components/templates/ResultZabo/ResultImageZabo.tsx index a3ca146a..47dc596c 100644 --- a/src/app/components/templates/ResultZabo/ResultImageZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultImageZabo.tsx @@ -15,10 +15,10 @@ import { ResultImageZaboProps } from './ResultZabo'; const ResultImageZabo = async ({ contents, - createdAt: rawCreatedAt, + createdAt, views, author, - currentDeadline: rawDeadline, + currentDeadline, tags, searchQuery, @@ -30,8 +30,6 @@ const ResultImageZabo = async ({ const localeContents = getLocaleContents(contents, lng); - const deadline = rawDeadline ? dayjs(rawDeadline) : undefined; - const createdAt = rawCreatedAt ? dayjs(rawCreatedAt) : undefined; const title = localeContents[0].title; return ( @@ -51,10 +49,10 @@ const ResultImageZabo = async ({ }} >
- {deadline && ( + {currentDeadline && (

- {{ dueAt: dayjs(deadline).format('LLL') }} + {{ dueAt: dayjs(currentDeadline).tz().format('LLL') }}

)} @@ -88,7 +86,7 @@ const ResultImageZabo = async ({
- {{ date: dayjs(createdAt).format('L') }} + {{ date: dayjs(createdAt).tz().format('L') }} · {{ views }}
diff --git a/src/app/components/templates/ResultZabo/ResultTextZabo.tsx b/src/app/components/templates/ResultZabo/ResultTextZabo.tsx index 2153195e..7519d913 100644 --- a/src/app/components/templates/ResultZabo/ResultTextZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultTextZabo.tsx @@ -17,15 +17,13 @@ const ResultTextZabo = async ({ createdAt, views, author, - currentDeadline: rawDeadline, + currentDeadline, tags, searchQuery, id, lng, }: ResultZaboProps) => { - const deadline = rawDeadline ? dayjs(rawDeadline) : undefined; - const { t } = await createTranslation(lng); const localeContents = getLocaleContents(contents, lng); @@ -41,10 +39,10 @@ const ResultTextZabo = async ({ } >
- {deadline && ( + {currentDeadline && (
- {{ dueAt: dayjs(deadline).format('LLL') }} + {{ dueAt: dayjs(currentDeadline).tz().format('LLL') }}
)} @@ -81,7 +79,7 @@ const ResultTextZabo = async ({
- {{ date: dayjs(createdAt).format('L') }} + {{ date: dayjs(createdAt).tz().format('L') }} · {{ views }}