diff --git a/frontend/src/components/gallery/GalleryLayout.tsx b/frontend/src/components/gallery/GalleryLayout.tsx index 635463d..873273c 100644 --- a/frontend/src/components/gallery/GalleryLayout.tsx +++ b/frontend/src/components/gallery/GalleryLayout.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { Calendar, Clock, Download, LogOut } from 'lucide-react'; -import { format, parseISO } from 'date-fns'; +import { parseISO } from 'date-fns'; import { useTranslation } from 'react-i18next'; +import { useLocalizedDate } from '../../hooks/useLocalizedDate'; import { Button } from '../common'; import { DynamicFavicon } from '../common/DynamicFavicon'; @@ -42,6 +43,7 @@ export const GalleryLayout: React.FC = ({ children, }) => { const { t } = useTranslation(); + const { format } = useLocalizedDate(); return (
{/* Dynamic Favicon */} @@ -78,13 +80,13 @@ export const GalleryLayout: React.FC = ({ {event.event_date && ( - {format(parseISO(event.event_date), 'MMMM d, yyyy')} + {format(parseISO(event.event_date), 'PP')} )} {event.expires_at && ( - {t('gallery.expires')} {format(parseISO(event.expires_at), 'MMM d')} + {t('gallery.expires')} {format(parseISO(event.expires_at), 'PP')} )}
diff --git a/frontend/src/pages/GalleryPage.tsx b/frontend/src/pages/GalleryPage.tsx index 7039b08..ebf8284 100644 --- a/frontend/src/pages/GalleryPage.tsx +++ b/frontend/src/pages/GalleryPage.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react'; import { useParams, Link } from 'react-router-dom'; import { Camera, Calendar, AlertCircle, Clock } from 'lucide-react'; -import { format, differenceInDays, parseISO } from 'date-fns'; +import { differenceInDays, parseISO } from 'date-fns'; import { useTranslation } from 'react-i18next'; +import { useLocalizedDate } from '../hooks/useLocalizedDate'; import { useQuery } from '@tanstack/react-query'; import { Card, CardContent, Input, Button, Loading, ReCaptcha } from '../components/common'; @@ -16,6 +17,7 @@ export const GalleryPage: React.FC = () => { const { slug, token } = useParams<{ slug: string; token?: string }>(); const { isAuthenticated, login, event } = useGalleryAuth(); const { t, i18n } = useTranslation(); + const { format } = useLocalizedDate(); const [password, setPassword] = useState(''); const [isLoggingIn, setIsLoggingIn] = useState(false); const [loginError, setLoginError] = useState(null); @@ -166,7 +168,7 @@ export const GalleryPage: React.FC = () => {

{t('gallery.expired')}

- {t('gallery.expiredOn', { date: format(parseISO(galleryInfo.expires_at), 'MMMM d, yyyy') })} + {t('gallery.expiredOn', { date: format(parseISO(galleryInfo.expires_at), 'PP') })}

{t('gallery.contactOrganizer')} @@ -226,7 +228,7 @@ export const GalleryPage: React.FC = () => {

- {format(parseISO(galleryInfo!.event_date), 'MMMM d, yyyy')} + {format(parseISO(galleryInfo!.event_date), 'PP')}