diff --git a/package.json b/package.json index cda204d..33bd394 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.80.1", + "version": "1.80.2", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index a2664b2..1cab1f0 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -780,6 +780,7 @@ export default function WeeklyView() { // Mobile detection const [isMobile, setIsMobile] = useState(false); + const [isPortrait, setIsPortrait] = useState(false); const [showMobileFabSheet, setShowMobileFabSheet] = useState(false); const [showMobileFabMenu, setShowMobileFabMenu] = useState(false); @@ -1207,9 +1208,12 @@ export default function WeeklyView() { } }, []); - // Mobile detection — track viewport width + // Mobile detection — track viewport width and orientation useEffect(() => { - const check = () => setIsMobile(window.innerWidth <= 768); + const check = () => { + setIsMobile(window.innerWidth <= 768); + setIsPortrait(window.innerHeight > window.innerWidth); + }; check(); window.addEventListener("resize", check); return () => window.removeEventListener("resize", check); @@ -5599,7 +5603,18 @@ export default function WeeklyView() { )} {syncError && } - {profile.headerDisplay === "none" ? "" : + {isPortrait ? (() => { + const today = new Date(); + const visibleDays = getVisibleDays(); + const isTodayInWeek = visibleDays.some(d => + d.getDate() === today.getDate() && + d.getMonth() === today.getMonth() && + d.getFullYear() === today.getFullYear() + ); + const refDate = isTodayInWeek ? today : getCWReferenceDate(visibleDays); + return refDate.toLocaleDateString(profile.language || "de-DE", { weekday: "short", day: "2-digit", month: "long", year: "numeric" }); + })() : + profile.headerDisplay === "none" ? "" : profile.headerDisplay === "date" ? (() => { const today = new Date(); const isTodayInWeek = getVisibleDays().some(d =>