mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 06:58:19 +02:00
Allow assigning tasks on weekends and improve calendar styling
Update task form schema to remove weekend restrictions for dates and enhance calendar component's weekend styling to be selectable. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/xVNiZBn
This commit is contained in:
1 parent
6831b2ea81
commit
adc9edcfd8
2 files changed
+6
-5
No files matched your search
@@ -19,16 +19,17 @@ import { CalendarIcon } from "lucide-react";
|
|||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import { fr } from "date-fns/locale";
|
import { fr } from "date-fns/locale";
|
||||||
|
|
||||||
// Schéma robuste avec dates de début et d'échéance pour production
|
// Schéma SANS restriction de week-end - tâches assignables 7j/7
|
||||||
const taskFormSchema = z.object({
|
const taskFormSchema = z.object({
|
||||||
title: z.string().min(1, "Le titre est requis"),
|
title: z.string().min(1, "Le titre est requis"),
|
||||||
description: z.string().optional(),
|
description: z.string().optional(),
|
||||||
priority: z.enum(["low", "medium", "high"]).default("medium"),
|
priority: z.enum(["low", "medium", "high"]).default("medium"),
|
||||||
status: z.enum(["pending", "completed"]).default("pending"),
|
status: z.enum(["pending", "completed"]).default("pending"),
|
||||||
assignedTo: z.string().min(1, "L'assignation est requise"),
|
assignedTo: z.string().min(1, "L'assignation est requise"),
|
||||||
startDate: z.date().optional(),
|
startDate: z.date().optional(), // AUTORISÉ : week-ends inclus
|
||||||
dueDate: z.date().optional(),
|
dueDate: z.date().optional(), // AUTORISÉ : week-ends inclus
|
||||||
}).refine((data) => {
|
}).refine((data) => {
|
||||||
|
// Validation basique : échéance >= début (AUCUNE restriction de jour de semaine)
|
||||||
if (data.startDate && data.dueDate) {
|
if (data.startDate && data.dueDate) {
|
||||||
return data.dueDate >= data.startDate;
|
return data.dueDate >= data.startDate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function Calendar({
|
|||||||
showOutsideDays = true,
|
showOutsideDays = true,
|
||||||
...props
|
...props
|
||||||
}: CalendarProps) {
|
}: CalendarProps) {
|
||||||
// Définir le modificateur pour les weekends (samedi = 6, dimanche = 0)
|
// Week-ends stylés mais TOUJOURS SÉLECTIONNABLES pour les tâches
|
||||||
const isWeekend = (date: Date) => {
|
const isWeekend = (date: Date) => {
|
||||||
const day = date.getDay();
|
const day = date.getDay();
|
||||||
return day === 0 || day === 6; // Dimanche ou Samedi
|
return day === 0 || day === 6; // Dimanche ou Samedi
|
||||||
@@ -32,7 +32,7 @@ function Calendar({
|
|||||||
...props.modifiersClassNames,
|
...props.modifiersClassNames,
|
||||||
}}
|
}}
|
||||||
modifiersStyles={{
|
modifiersStyles={{
|
||||||
weekend: { backgroundColor: '#f3f4f6' },
|
weekend: { backgroundColor: '#f0f9ff', border: '1px solid #bfdbfe' }, // Bleu clair pour week-ends
|
||||||
...props.modifiersStyles,
|
...props.modifiersStyles,
|
||||||
}}
|
}}
|
||||||
classNames={{
|
classNames={{
|
||||||
|
|||||||
Reference in new issue
Block a user