mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-12 01:37:40 +02:00
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:
1 file changed
+14
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user