-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask-5
26 lines (24 loc) · 969 Bytes
/
task-5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import * as React from "react";
import dayjs from "dayjs";
import { DemoContainer, DemoItem } from "@mui/x-date-pickers/internals/demo";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import { DateCalendar } from "@mui/x-date-pickers/DateCalendar";
export default function DateCalendarValue() {
const [value, setValue] = React.useState(dayjs("2022-04-17"));
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={["DateCalendar", "DateCalendar"]}>
<DemoItem label="Uncontrolled calendar">
<DateCalendar defaultValue={dayjs("2022-04-17")} />
</DemoItem>
<DemoItem label="Controlled calendar">
<DateCalendar
value={value}
onChange={(newValue) => setValue(newValue)}
/>
</DemoItem>
</DemoContainer>
</LocalizationProvider>
);
}