From 64ce3b83c8fc106988f14802ada1b626095d24bd Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Fri, 13 Nov 2026 11:53:36 +0100 Subject: [PATCH] Day view title: call the month title directly (#501) --- .../calendula/ui/common/CalendarTitle.kt | 3 +-- .../jeanlucmakiola/calendula/ui/week/WeekScreen.kt | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarTitle.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarTitle.kt index 8b873595..781fad50 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarTitle.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/CalendarTitle.kt @@ -8,8 +8,7 @@ import java.util.Locale * out in [locale]'s own order, with the year shown only when [date] falls outside * [currentYear]. * - * Pass [skeleton] *without* a year field — "LLLL" for a month, "EEEdMMM" for a - * day. A skeleton is a field list, so wanting the year is just asking for one + * Pass [skeleton] *without* a year field, e.g. "LLLL" for a month. A skeleton is a field list, so wanting the year is just asking for one * more field; the locale still decides where it lands ("July 2026" vs "2026年7月"). * * Dropping the year in the current year is the one bit of policy here: the title diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt index 5fa8dcfd..b261e4a4 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/week/WeekScreen.kt @@ -310,11 +310,6 @@ internal enum class TimelineKind( // A run of days often straddles two weeks, so no single number fits it. MultiDay(showWeekNumber = false, todayText = R.string.week_today_action, headerBias = 0f), Day(showWeekNumber = false, todayText = R.string.day_today_action, headerBias = -1f), - ; - - // The day view names the month too: its header already shows weekday and date (#501). - fun title(start: LocalDate, end: LocalDate, locale: Locale, currentYear: Int, abbreviated: Boolean): String = - formatWeekTitle(start, end, locale, currentYear, abbreviated) } internal val CalendarView.timelineKind: TimelineKind @@ -489,9 +484,10 @@ private fun PagedTimelineScreen( val jumpToToday = { jumpToDate(today) } val locale = currentLocale() - val (title, shortTitle) = remember(titleKind, weekStart, weekEnd, locale, today.year) { - titleKind.title(weekStart, weekEnd, locale, today.year, abbreviated = false) to - titleKind.title(weekStart, weekEnd, locale, today.year, abbreviated = true) + // Every timeline names the month, the day view too: its header already shows weekday and date (#501). + val (title, shortTitle) = remember(weekStart, weekEnd, locale, today.year) { + formatWeekTitle(weekStart, weekEnd, locale, today.year, abbreviated = false) to + formatWeekTitle(weekStart, weekEnd, locale, today.year, abbreviated = true) } PublishChrome( ScreenChrome(