-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpage.tsx
More file actions
59 lines (53 loc) · 1.43 KB
/
Copy pathpage.tsx
File metadata and controls
59 lines (53 loc) · 1.43 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { ModeToggle } from '@/components/theme-toggle';
import {
Calendar,
CalendarCurrentDate,
CalendarDayView,
CalendarNextTrigger,
CalendarPrevTrigger,
CalendarTodayTrigger,
} from '@/components/ui/full-calendar';
import { addHours } from 'date-fns';
import { ChevronLeft, ChevronRight } from 'lucide-react';
export default function Page() {
return (
<Calendar
view="day"
events={[
{
id: '1',
start: new Date(),
end: addHours(new Date(), 2),
title: 'event A',
color: 'pink',
},
{
id: '2',
start: addHours(new Date(), 1.5),
end: addHours(new Date(), 3),
title: 'event B',
color: 'blue',
},
]}
>
<div className="h-dvh p-14 flex flex-col">
<div className="flex px-6 items-center gap-2 mb-6">
<CalendarCurrentDate />
<CalendarPrevTrigger>
<ChevronLeft size={20} />
<span className="sr-only">Previous</span>
</CalendarPrevTrigger>
<CalendarTodayTrigger>Today</CalendarTodayTrigger>
<CalendarNextTrigger>
<ChevronRight size={20} />
<span className="sr-only">Next</span>
</CalendarNextTrigger>
<ModeToggle />
</div>
<div className="flex-1 px-6 overflow-hidden">
<CalendarDayView />
</div>
</div>
</Calendar>
);
}