Checkpoint: Corrections apportées :
1. Bug décalage horaire dans le formulaire d'édition des séquences - Correction de la fonction safeFormatDate pour utiliser les méthodes locales (getHours, getMinutes) au lieu des méthodes UTC - Les heures saisies (ex: 9h00) s'affichent maintenant correctement dans le formulaire d'édition 2. Ajout du menu de navigation sur la page Import Excel - Intégration du DashboardLayout wrapper dans AdminImportExcel.tsx - Le menu latéral s'affiche maintenant correctement sur cette page 3. Déplacement du menu "Import Excel" - Déplacé du bloc GESTION vers le bloc CONFIGURATION dans le menu de navigation - Positionné après "Utilisateurs" et avant "Rappels" pour une meilleure organisation
This commit is contained in:
@@ -41,13 +41,13 @@ const menuSections = [
|
||||
{ icon: Calendar, label: "Séquences", path: "/admin/sequences" },
|
||||
{ icon: CalendarDays, label: "Calendrier", path: "/admin/calendrier" },
|
||||
{ icon: Users, label: "Apprenants", path: "/admin/apprenants" },
|
||||
{ icon: FileSpreadsheet, label: "Import Excel", path: "/admin/import-excel" },
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Configuration",
|
||||
items: [
|
||||
{ icon: UserCog, label: "Utilisateurs", path: "/admin/users" },
|
||||
{ icon: FileSpreadsheet, label: "Import Excel", path: "/admin/import-excel" },
|
||||
{ icon: Bell, label: "Rappels", path: "/admin/rappels" },
|
||||
{ icon: Mail, label: "Templates d'emails", path: "/admin/email-templates" },
|
||||
{ icon: Settings, label: "Configuration SMTP", path: "/admin/email-config" },
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { trpc } from "@/lib/trpc";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import DashboardLayout from "@/components/DashboardLayout";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
@@ -107,7 +108,8 @@ export default function AdminImportExcel() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="container mx-auto py-8">
|
||||
<DashboardLayout>
|
||||
<div className="container mx-auto py-8">
|
||||
<div className="mb-8">
|
||||
<h1 className="text-3xl font-bold mb-2">Import Excel - Formations et Séquences</h1>
|
||||
<p className="text-muted-foreground">
|
||||
@@ -325,6 +327,7 @@ export default function AdminImportExcel() {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</DashboardLayout>
|
||||
);
|
||||
}
|
||||
@@ -106,12 +106,13 @@ export default function AdminSequences() {
|
||||
try {
|
||||
// Si c'est un objet Date JavaScript
|
||||
if (dateValue instanceof Date) {
|
||||
// Utiliser les méthodes UTC pour éviter le décalage horaire
|
||||
const year = dateValue.getUTCFullYear();
|
||||
const month = String(dateValue.getUTCMonth() + 1).padStart(2, '0');
|
||||
const day = String(dateValue.getUTCDate()).padStart(2, '0');
|
||||
const hours = String(dateValue.getUTCHours()).padStart(2, '0');
|
||||
const minutes = String(dateValue.getUTCMinutes()).padStart(2, '0');
|
||||
// MySQL stocke les dates en heure locale (pas UTC)
|
||||
// Donc on utilise les méthodes locales pour extraire les valeurs
|
||||
const year = dateValue.getFullYear();
|
||||
const month = String(dateValue.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(dateValue.getDate()).padStart(2, '0');
|
||||
const hours = String(dateValue.getHours()).padStart(2, '0');
|
||||
const minutes = String(dateValue.getMinutes()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}T${hours}:${minutes}`;
|
||||
}
|
||||
|
||||
|
||||
16
todo.md
16
todo.md
@@ -691,3 +691,19 @@
|
||||
- [x] Vérifier la gestion des fuseaux horaires dans le formulaire
|
||||
- [x] Corriger la conversion des dates/heures (UTC pour affichage et envoi)
|
||||
- [x] Tester la saisie et l'affichage des heures
|
||||
|
||||
## Bug décalage horaire dans formulaire d'édition
|
||||
|
||||
- [x] Identifier pourquoi le formulaire affiche -2h (ex: 9h00 → 7h00) (utilisation de méthodes UTC au lieu de locales)
|
||||
- [x] Corriger la fonction safeFormatDate (utiliser getHours() au lieu de getUTCHours())
|
||||
- [ ] Tester l'édition de séquences
|
||||
|
||||
## Bug page d'import Excel sans menu
|
||||
|
||||
- [x] Ajouter le DashboardLayout wrapper à la page d'import Excel
|
||||
- [x] Vérifier que le menu de navigation s'affiche correctement
|
||||
|
||||
## Déplacement menu Import Excel
|
||||
|
||||
- [x] Déplacer "Import Excel" du bloc GESTION vers le bloc CONFIGURATION
|
||||
- [x] Vérifier l'affichage dans le menu de navigation
|
||||
|
||||
Reference in New Issue
Block a user