Implement calendar module
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { CalendarShell } from "@/modules/calendar/components/calendar-shell";
|
||||
import { listCalendars, listEvents } from "@/modules/calendar/server/queries";
|
||||
|
||||
export default async function CalendarPage() {
|
||||
const now = new Date();
|
||||
const from = new Date(now);
|
||||
from.setMonth(from.getMonth() - 2);
|
||||
const to = new Date(now);
|
||||
to.setMonth(to.getMonth() + 10);
|
||||
|
||||
const [calendars, events] = await Promise.all([
|
||||
listCalendars(),
|
||||
listEvents({ from, to, calendarIds: "all" }),
|
||||
]);
|
||||
|
||||
return <CalendarShell calendars={calendars} events={events} />;
|
||||
}
|
||||
Reference in New Issue
Block a user