Calendar events support multiple reminder offsets with presets and per-user defaults. Lists index adds inline task entry and list property editing. Generic entity comments on list detail. New bangs.stats dashboard widget. Closes Gitea #28, #29, #30, #31. Migrations 0022 and 0023.
33 lines
930 B
TypeScript
33 lines
930 B
TypeScript
import { CalendarShell } from "@/modules/calendar/components/calendar-shell";
|
|
import {
|
|
getDefaultEventReminderOffsets,
|
|
listCalendars,
|
|
listEvents,
|
|
} from "@/modules/calendar/server/queries";
|
|
import { getCurrentSession } from "@/lib/session";
|
|
import type { CalView } from "@/modules/_core/themes";
|
|
|
|
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 [{ user }, calendars, events, defaultReminderOffsets] = await Promise.all([
|
|
getCurrentSession(),
|
|
listCalendars(),
|
|
listEvents({ from, to, calendarIds: "all" }),
|
|
getDefaultEventReminderOffsets(),
|
|
]);
|
|
|
|
return (
|
|
<CalendarShell
|
|
calendars={calendars}
|
|
events={events}
|
|
defaultView={user.themeCalView as CalView}
|
|
defaultReminderOffsets={defaultReminderOffsets}
|
|
/>
|
|
);
|
|
}
|