diff --git a/src/routes/(app)/calendar/+page.svelte b/src/routes/(app)/calendar/+page.svelte
index 6e7296efb3..2267c1c799 100644
--- a/src/routes/(app)/calendar/+page.svelte
+++ b/src/routes/(app)/calendar/+page.svelte
@@ -14,6 +14,11 @@
import CalendarEventModal from '$lib/components/calendar/CalendarEventModal.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
import Plus from '$lib/components/icons/Plus.svelte';
+ import Tooltip from '$lib/components/common/Tooltip.svelte';
+ import SidebarIcon from '$lib/components/icons/Sidebar.svelte';
+ import Select from '$lib/components/common/Select.svelte';
+ import Check from '$lib/components/icons/Check.svelte';
+ import ChevronDown from '$lib/components/icons/ChevronDown.svelte';
const i18n = getContext('i18n');
@@ -29,6 +34,22 @@
let editEvent: CalendarEventModel | null = null;
let defaultStartAt: number | null = null;
+ const MONTH_NAMES = [
+ 'January',
+ 'February',
+ 'March',
+ 'April',
+ 'May',
+ 'June',
+ 'July',
+ 'August',
+ 'September',
+ 'October',
+ 'November',
+ 'December'
+ ];
+ const DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+
function getVisibleRange(): { start: string; end: string } {
const d = new Date(currentDate);
let start: Date;
@@ -128,8 +149,29 @@
showEventModal = true;
}
+ function navigateCalendar(delta: number) {
+ const d = new Date(currentDate);
+ if (view === 'month') {
+ d.setDate(1);
+ d.setMonth(d.getMonth() + delta);
+ } else if (view === 'week') d.setDate(d.getDate() + delta * 7);
+ else d.setDate(d.getDate() + delta);
+ currentDate = d;
+ handleNavigate();
+ }
+
+ function goToToday() {
+ currentDate = new Date();
+ handleNavigate();
+ }
+
$: defaultCalendarId = calendars.find((c) => c.is_default)?.id || calendars[0]?.id || '';
+ $: headerText =
+ view === 'day'
+ ? `${DAY_NAMES[currentDate.getDay()]}, ${MONTH_NAMES[currentDate.getMonth()]} ${currentDate.getDate()}, ${currentDate.getFullYear()}`
+ : `${MONTH_NAMES[currentDate.getMonth()]} ${currentDate.getFullYear()}`;
+
onMount(async () => {
await loadCalendars();
await refresh();
@@ -157,17 +199,134 @@
: ''} max-w-full"
>
{#if loaded}
+
+
+
-
-
-
+