fix: show currently visible day in mobile portrait header

In portrait mode the header now always shows the day currently on
screen (getVisibleDays()[0]), so swiping left/right updates the
header to reflect the active day. Formatted as weekday + full date
using the user's locale (e.g. "Mo., 30. März 2026").

v1.80.3
This commit is contained in:
mARTin 2026-03-31 07:51:40 +02:00
parent 687e1e1d08
commit 7306549311
2 changed files with 3 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "my-weekly-todo-list", "name": "my-weekly-todo-list",
"version": "1.80.2", "version": "1.80.3",
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -5604,15 +5604,8 @@ export default function WeeklyView() {
{syncError && <AlertCircle size={14} className="text-red-500" />} {syncError && <AlertCircle size={14} className="text-red-500" />}
<span> <span>
{isPortrait ? (() => { {isPortrait ? (() => {
const today = new Date(); const shownDay = getVisibleDays()[0];
const visibleDays = getVisibleDays(); return shownDay.toLocaleDateString(profile.language || "de-DE", { weekday: "short", day: "2-digit", month: "long", year: "numeric" });
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 === "none" ? "" :
profile.headerDisplay === "date" ? (() => { profile.headerDisplay === "date" ? (() => {