mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-10 03:27:57 +00:00
refac
This commit is contained in:
parent
81b5346c26
commit
34abd6e121
2 changed files with 4 additions and 4 deletions
|
|
@ -11,6 +11,7 @@
|
|||
export let visibleCalendarIds: Set<string> = new Set();
|
||||
export let view: 'month' | 'week' | 'day' = 'month';
|
||||
export let currentDate: Date = new Date();
|
||||
export let onNavigate: () => void = () => {};
|
||||
|
||||
const NS = 1_000_000;
|
||||
const DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||
|
|
@ -120,6 +121,7 @@
|
|||
|
||||
function handleDayClick(day: Date) {
|
||||
currentDate = day;
|
||||
onNavigate();
|
||||
const ms = new Date(day.getFullYear(), day.getMonth(), day.getDate(), 9).getTime();
|
||||
dispatch('createEvent', { start_at: ms * NS });
|
||||
}
|
||||
|
|
@ -127,8 +129,7 @@
|
|||
function goToDayView(day: Date) {
|
||||
currentDate = day;
|
||||
view = 'day';
|
||||
dispatch('viewChange', view);
|
||||
dispatch('navigate', { date: currentDate });
|
||||
onNavigate();
|
||||
}
|
||||
|
||||
function handleHourClick(day: Date, hour: number) {
|
||||
|
|
|
|||
|
|
@ -370,8 +370,7 @@
|
|||
bind:currentDate
|
||||
on:createEvent={handleCreateEvent}
|
||||
on:eventClick={handleEventClick}
|
||||
on:navigate={handleNavigate}
|
||||
on:viewChange={handleNavigate}
|
||||
onNavigate={handleNavigate}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue