refactor: date utils and all calls

This commit is contained in:
Julien Froidefond
2025-09-21 11:41:17 +02:00
parent 799a21df5c
commit 557cdebc13
23 changed files with 300 additions and 117 deletions

View File

@@ -8,6 +8,7 @@ import { Card, CardHeader, CardContent } from '@/components/ui/Card';
import { Input } from '@/components/ui/Input';
import { Modal } from '@/components/ui/Modal';
import { Header } from '@/components/ui/Header';
import { formatDateForDisplay } from '@/lib/date-utils';
import Link from 'next/link';
interface BackupSettingsPageClientProps {
@@ -193,16 +194,8 @@ export default function BackupSettingsPageClient({ initialData }: BackupSettings
const formatDate = (date: string | Date): string => {
// Format cohérent serveur/client pour éviter les erreurs d'hydratation
const d = new Date(date);
return d.toLocaleDateString('fr-FR', {
day: '2-digit',
month: '2-digit',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
});
const d = typeof date === 'string' ? new Date(date) : date;
return formatDateForDisplay(d, 'DISPLAY_MEDIUM');
};
if (isLoading) {