Event search (Ctrl+F), locale/RTL handling, weekday selector workday/weekend, refactored event handling, Firefox compatibility #3

Merged
LeoVasanko merged 17 commits from vol003 into main 2025-08-27 13:41:46 +01:00
Showing only changes of commit 7ba5494ae5 - Show all commits

View File

@ -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>