Merge pull request #222 from R0m1k3/1.1

Make weekend days in the calendar display with a light gray background
This commit is contained in:
LogiFlow authored and GitHub committed 2025-08-18 14:50:42 +02:00
commit e5610abc6b
1 file changed
+14
+14
View File
@@ -13,10 +13,24 @@ function Calendar({
showOutsideDays = true,
...props
}: CalendarProps) {
// Définir le modificateur pour les weekends (samedi = 6, dimanche = 0)
const isWeekend = (date: Date) => {
const day = date.getDay();
return day === 0 || day === 6; // Dimanche ou Samedi
};
return (
<DayPicker
showOutsideDays={showOutsideDays}
className={cn("p-3", className)}
modifiers={{
weekend: isWeekend,
...props.modifiers,
}}
modifiersClassNames={{
weekend: "bg-gray-100 dark:bg-gray-800",
...props.modifiersClassNames,
}}
classNames={{
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
month: "space-y-4",