1 | import React from "react";
|
2 |
|
3 | import { addDays } from "date-fns";
|
4 | import { DayPicker } from "react-day-picker";
|
5 |
|
6 | import customStyles from "./styles/styling-modifiers.module.css";
|
7 |
|
8 | const today = new Date();
|
9 | const beforeYesterday = addDays(today, -2);
|
10 |
|
11 | export function StylingModifiers() {
|
12 | return (
|
13 | <DayPicker
|
14 | mode="single"
|
15 | selected={new Date()}
|
16 | disabled={beforeYesterday}
|
17 | modifiersClassNames={{
|
18 | selected: customStyles.purpleToday
|
19 | }}
|
20 | modifiersStyles={{
|
21 | disabled: {
|
22 |
|
23 | textDecoration: "line-through"
|
24 | }
|
25 | }}
|
26 | />
|
27 | );
|
28 | }
|