diff --git a/src/App.svelte b/src/App.svelte index 0286a32..dc8b509 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -21,11 +21,12 @@ let openModal = false; const toggle = () => (openModal = !openModal); + const mobile = window.innerWidth < 765; let calendar; let options = writable({ - initialView: window.innerWidth < 765 ? 'listWeek' : 'timeGridWeek', + initialView: mobile ? 'listWeek' : 'timeGridWeek', plugins: [ timeGridPlugin, dayGridPlugin, @@ -37,9 +38,11 @@ locale: frLocale, allDayContent: '', headerToolbar: { - left: 'prev,next today', + left: mobile ? false : 'prev,next today', center: 'title', - right: 'dayGridMonth,timeGridWeek,listWeek' + right: mobile + ? 'prev,today,next dayGridMonth,timeGridWeek,listWeek' + : 'dayGridMonth,timeGridWeek,listWeek' }, height: '100%', schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives', @@ -49,7 +52,11 @@ openModal = true; event.set(info.event); }, - titleFormat: { year: '2-digit', month: 'numeric', day: 'numeric' }, + titleFormat: { + year: mobile ? '2-digit' : 'numeric', + month: mobile ? 'numeric' : 'long', + day: 'numeric' + }, events: [], themeSystem: 'bootstrap5' }); @@ -82,8 +89,8 @@ $: updateEvents(selectedCalendars); -