diff --git a/package.json b/package.json index a5ddc93..bb350e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.34.3", + "version": "1.34.4", "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 27ede0e..d424751 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -6420,37 +6420,42 @@ export default function WeeklyView() { gap: profile.dateAlignment === "tight" ? "2px" : (profile.dayHeaderGap || "0.35em"), }} > - {activeDateLayout === "left" && ( - - {formatDateHeader(date, language)} - - )} -

- {getDayName(date, language, weekdayFormat, customWeekdayNames, weekStartDay, weekdayCase)} -

- {(activeDateLayout === "right" || - activeDateLayout === "above" || - activeDateLayout === "below" || - activeDateLayout === undefined) && ( - - {formatDateHeader(date, language)} - - )} + {(() => { + // Compute date vertical offset relative to weekday font size + const isHorizontal = activeDateLayout === "left" || activeDateLayout === "right" || activeDateLayout === undefined; + const headlineSizePx = parseFloat(profile.headlineFontSize || "1.25rem") * (String(profile.headlineFontSize || "").includes("px") ? 1 : 16); + const dateOffset = !isHorizontal ? undefined + : profile.dateVerticalAlign === "top" ? `${-headlineSizePx * 0.55}px` + : profile.dateVerticalAlign === "bottom" ? "0px" + : `${-headlineSizePx * 0.25}px`; // center + const dateStyle = isHorizontal ? { + flexShrink: 0 as const, marginBottom: 0, + position: "relative" as const, top: dateOffset, + } : { flexShrink: 0 as const }; + return ( + <> + {activeDateLayout === "left" && ( + + {formatDateHeader(date, language)} + + )} +

+ {getDayName(date, language, weekdayFormat, customWeekdayNames, weekStartDay, weekdayCase)} +

+ {(activeDateLayout === "right" || + activeDateLayout === "above" || + activeDateLayout === "below" || + activeDateLayout === undefined) && ( + + {formatDateHeader(date, language)} + + )} + + ); + })()}