Event search (Ctrl+F), locale/RTL handling, weekday selector workday/weekend, refactored event handling, Firefox compatibility #3
14
src/App.vue
14
src/App.vue
@ -1,9 +1,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
|
||||||
import CalendarView from './components/CalendarView.vue'
|
import CalendarView from './components/CalendarView.vue'
|
||||||
import EventDialog from './components/EventDialog.vue'
|
import EventDialog from './components/EventDialog.vue'
|
||||||
import { useCalendarStore } from './stores/CalendarStore'
|
import { useCalendarStore } from './stores/CalendarStore'
|
||||||
import { lang } from './utils/locale'
|
import { lang } from './utils/locale'
|
||||||
|
import { formatTodayString } from './utils/date'
|
||||||
|
|
||||||
const eventDialog = ref(null)
|
const eventDialog = ref(null)
|
||||||
const calendarStore = useCalendarStore()
|
const calendarStore = useCalendarStore()
|
||||||
@ -38,6 +39,8 @@ onMounted(() => {
|
|||||||
document.addEventListener('keydown', handleGlobalKey, { passive: false })
|
document.addEventListener('keydown', handleGlobalKey, { passive: false })
|
||||||
// Set document language via shared util
|
// Set document language via shared util
|
||||||
if (lang) document.documentElement.setAttribute('lang', lang)
|
if (lang) document.documentElement.setAttribute('lang', lang)
|
||||||
|
// Initialize title
|
||||||
|
document.title = formatTodayString(new Date(calendarStore.now))
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@ -61,6 +64,15 @@ const handleEditEvent = (eventClickPayload) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleClearSelection = () => {}
|
const handleClearSelection = () => {}
|
||||||
|
|
||||||
|
// Watch today's date to update document title
|
||||||
|
watch(
|
||||||
|
() => calendarStore.now,
|
||||||
|
(val) => {
|
||||||
|
document.title = formatTodayString(new Date(val))
|
||||||
|
},
|
||||||
|
{ immediate: false },
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user