diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/DailyDigestNotifier.kt b/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/DailyDigestNotifier.kt index e708c00d..e30755ca 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/DailyDigestNotifier.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/DailyDigestNotifier.kt @@ -14,6 +14,7 @@ import de.jeanlucmakiola.calendula.data.prefs.SettingsPrefs import de.jeanlucmakiola.calendula.data.prefs.is24Hour import de.jeanlucmakiola.calendula.data.prefs.resolveFirstDay import de.jeanlucmakiola.calendula.domain.reminders.ReminderEventInstance +import de.jeanlucmakiola.floret.locale.capitalizeStart import kotlinx.coroutines.flow.first import kotlinx.datetime.isoDayNumber import kotlinx.datetime.toKotlinLocalDate @@ -62,7 +63,7 @@ class DailyDigestNotifier @Inject constructor( today -> context.getString(R.string.digest_day_relative, context.getString(R.string.reminder_day_today), date) today.plusDays(1) -> context.getString(R.string.digest_day_relative, context.getString(R.string.reminder_day_tomorrow), date) - else -> date + else -> date.capitalizeStart(locale) } val allDay = context.getString(R.string.event_detail_all_day) val lines = listed.map { entry -> diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/ReminderTimeText.kt b/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/ReminderTimeText.kt index 9e983d80..d9183015 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/ReminderTimeText.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/data/reminders/ReminderTimeText.kt @@ -2,6 +2,7 @@ package de.jeanlucmakiola.calendula.data.reminders import de.jeanlucmakiola.calendula.domain.runsMidnightToMidnight import de.jeanlucmakiola.calendula.ui.common.timeOfDayFormatter +import de.jeanlucmakiola.floret.locale.capitalizeStart import java.time.DayOfWeek import java.time.Instant import java.time.LocalDate @@ -121,7 +122,7 @@ private fun relativeDayPrefix( 1L -> tomorrowLabel -1L -> yesterdayLabel else -> if (isSameWeek(day, today, firstDayOfWeek)) { - day.dayOfWeek.getDisplayName(TextStyle.SHORT, locale) + day.dayOfWeek.getDisplayName(TextStyle.SHORT, locale).capitalizeStart(locale) } else { dateFormat.format(day) } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRange.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRange.kt index 645a93e3..f15c0da0 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRange.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRange.kt @@ -1,5 +1,6 @@ package de.jeanlucmakiola.calendula.ui.agenda +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import kotlinx.datetime.DayOfWeek import kotlinx.datetime.LocalDate @@ -113,7 +114,7 @@ fun agendaRangeWindowSummary( return when { range == AgendaRange.Day -> dayMonthYear.format(javaStart) range == AgendaRange.ThisMonth && !monthAsSpan -> - localizedDateFormatter(locale, "LLLLy").format(javaStart) + localizedDateFormatter(locale, "LLLLy").format(javaStart).capitalizeStart(locale) else -> { val startFmt = if (start.year == end.year) dayMonth else dayMonthYear "${startFmt.format(javaStart)} – ${dayMonthYear.format(javaEnd)}" diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRows.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRows.kt index 06df9351..826ab584 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRows.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/agenda/AgendaRows.kt @@ -46,6 +46,7 @@ import de.jeanlucmakiola.floret.components.Position import de.jeanlucmakiola.floret.components.positionOf import de.jeanlucmakiola.floret.identity.LocalFloretDarkTheme import de.jeanlucmakiola.floret.identity.animateItemMotion +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.currentLocale import de.jeanlucmakiola.floret.locale.localizedDateFormatter import kotlinx.datetime.DateTimeUnit @@ -212,7 +213,7 @@ private fun formatAgendaDate(date: LocalDate): String { val java = date.toJavaLocalDate() // Weekday + date in the locale's own field order (e.g. "Wed, Jun 17, 2026" // vs "Mi., 17. Juni 2026") rather than a hardcoded day-month-year layout. - return localizedDateFormatter(locale, "EEEdMMMy").format(java) + return localizedDateFormatter(locale, "EEEdMMMy").format(java).capitalizeStart(locale) } /** 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 ccac0372..4bd1d9a8 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 @@ -1,5 +1,6 @@ package de.jeanlucmakiola.calendula.ui.common +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import java.util.Locale @@ -30,5 +31,5 @@ fun formatCalendarTitle( forceYear: Boolean = false, ): String { val fields = if (date.year == currentYear && !forceYear) skeleton else skeleton + "y" - return localizedDateFormatter(locale, fields).format(date) + return localizedDateFormatter(locale, fields).format(date).capitalizeStart(locale) } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/SelectionTopBar.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/SelectionTopBar.kt index d9d69b71..70b48a91 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/SelectionTopBar.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/SelectionTopBar.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import de.jeanlucmakiola.calendula.R import de.jeanlucmakiola.calendula.domain.EventInstance +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.currentLocale import de.jeanlucmakiola.floret.locale.localizedDateFormatter import java.time.ZoneId @@ -89,7 +90,7 @@ private fun formatSelectionWhen(event: EventInstance, use24Hour: Boolean, locale val endsSameDay = end.toLocalDate() == start.toLocalDate() || (end.toLocalTime().toSecondOfDay() == 0 && end.toLocalDate() == start.toLocalDate().plusDays(1)) return if (endsSameDay) { - "${day.format(start)} · ${time.format(start)}–${time.format(end)}" + "${day.format(start).capitalizeStart(locale)} · ${time.format(start)}–${time.format(end)}" } else { "${day.format(start)}, ${time.format(start)} – ${day.format(end)}, ${time.format(end)}" } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt index 403b3f1a..50592f52 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt @@ -104,6 +104,7 @@ import de.jeanlucmakiola.calendula.ui.common.rememberFieldCopier import de.jeanlucmakiola.calendula.ui.common.icuTimeZoneRegion import de.jeanlucmakiola.calendula.ui.common.LocalSoftenColors import de.jeanlucmakiola.calendula.ui.common.eventAccent +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.currentLocale import de.jeanlucmakiola.calendula.ui.common.LocalUse24HourFormat import de.jeanlucmakiola.calendula.ui.common.timeOfDayFormatter @@ -849,7 +850,7 @@ private fun formatWhen( val startDate = instance.start.toJavaLocalDateTime(utc).toLocalDate() val lastDate = (instance.end - 1.seconds).toJavaLocalDateTime(utc).toLocalDate() return if (startDate == lastDate) { - allDayLabel to dateFull.format(startDate) + allDayLabel to dateFull.format(startDate).capitalizeStart(locale) } else { allDayLabel to "${dateMedium.format(startDate)} – ${dateMedium.format(lastDate)}" } @@ -859,7 +860,7 @@ private fun formatWhen( val startTime = withRepeatedHourZone(timeShort.format(startLdt), instance.start, zone, locale) val endTime = withRepeatedHourZone(timeShort.format(endLdt), instance.end, zone, locale) return if (startLdt.toLocalDate() == endLdt.toLocalDate()) { - dateFull.format(startLdt.toLocalDate()) to "$startTime – $endTime" + dateFull.format(startLdt.toLocalDate()).capitalizeStart(locale) to "$startTime – $endTime" } else { val start = "${dateMedium.format(startLdt.toLocalDate())} $startTime" val end = "${dateMedium.format(endLdt.toLocalDate())} $endTime" diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt index 46b8a0f1..7a78eb26 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/month/MonthScreen.kt @@ -31,6 +31,7 @@ import de.jeanlucmakiola.calendula.ui.common.morphEvent import de.jeanlucmakiola.calendula.ui.common.jumpToPage import de.jeanlucmakiola.calendula.ui.common.rememberCalendarPageSpec import de.jeanlucmakiola.floret.identity.LocalFloretDarkTheme +import de.jeanlucmakiola.floret.locale.capitalizeStart import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.drop import androidx.compose.animation.ExperimentalSharedTransitionApi @@ -798,7 +799,7 @@ internal fun WeekdayHeader(weekStart: DayOfWeek, showWeekNumbers: Boolean) { val isWeekend = dow == DayOfWeek.SATURDAY || dow == DayOfWeek.SUNDAY val javaDow = dow.toJavaDayOfWeek() Text( - text = javaDow.getDisplayName(JavaTextStyle.SHORT, locale), + text = javaDow.getDisplayName(JavaTextStyle.SHORT, locale).capitalizeStart(locale), style = MaterialTheme.typography.labelMedium, color = if (isWeekend) MaterialTheme.colorScheme.onSurfaceVariant else MaterialTheme.colorScheme.onSurface, @@ -2842,6 +2843,7 @@ private fun shortMonthName(date: LocalDate): String { return remember(date.month, locale) { date.month.toJavaMonth() .getDisplayName(JavaTextStyle.SHORT, locale) + .capitalizeStart(locale) } } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/search/SearchScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/search/SearchScreen.kt index 018cf5e1..56088eae 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/search/SearchScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/search/SearchScreen.kt @@ -88,6 +88,7 @@ import de.jeanlucmakiola.floret.components.Position import de.jeanlucmakiola.floret.components.SnackChip import de.jeanlucmakiola.floret.components.SnackChipHeight import de.jeanlucmakiola.floret.components.SnackChipMargin +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.currentLocale import de.jeanlucmakiola.floret.locale.localizedDateFormatter import de.jeanlucmakiola.calendula.ui.common.EventDimAlpha @@ -470,6 +471,7 @@ private fun monthLabel(month: SearchMonth): String { return remember(month.year, month.monthNumber, locale) { localizedDateFormatter(locale, "LLLLy") .format(java.time.LocalDate.of(month.year, month.monthNumber, 1)) + .capitalizeStart(locale) } } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/settings/ViewsSettings.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/settings/ViewsSettings.kt index d6b8eab6..6ee868ec 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/settings/ViewsSettings.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/settings/ViewsSettings.kt @@ -53,6 +53,7 @@ import de.jeanlucmakiola.floret.components.OptionPicker import de.jeanlucmakiola.floret.components.Position import de.jeanlucmakiola.floret.components.ReorderableColumn import de.jeanlucmakiola.floret.components.ReorderableRowHeight +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.currentLocale import kotlinx.datetime.DayOfWeek import java.time.format.TextStyle as JavaTextStyle @@ -516,6 +517,7 @@ internal fun weekStartLabel(pref: WeekStartPref): String = when (pref) { // Localised weekday name, so no per-day string resource is needed. is WeekStartPref.Day -> pref.day.toJavaDayOfWeek() .getDisplayName(JavaTextStyle.FULL, currentLocale()) + .capitalizeStart(currentLocale()) } @Composable 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 cb6607fa..0f00f711 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 @@ -21,6 +21,7 @@ import de.jeanlucmakiola.calendula.ui.common.rememberViewSwitchSpec import de.jeanlucmakiola.calendula.ui.common.jumpToPage import de.jeanlucmakiola.calendula.ui.common.pagedHeight import de.jeanlucmakiola.floret.identity.LocalFloretDarkTheme +import de.jeanlucmakiola.floret.locale.capitalizeStart import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.drop import androidx.compose.foundation.background @@ -1106,7 +1107,7 @@ private fun WeekDayHeader( ) { // One line, as the gutter cell beside it assumes (see WeekNumberCell). Text( - text = javaDow.getDisplayName(JavaTextStyle.SHORT, locale), + text = javaDow.getDisplayName(JavaTextStyle.SHORT, locale).capitalizeStart(locale), style = MaterialTheme.typography.labelSmall, maxLines = 1, overflow = TextOverflow.Clip, diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/WidgetParts.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/WidgetParts.kt index 10e2ce36..54c04691 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/WidgetParts.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/WidgetParts.kt @@ -11,6 +11,7 @@ import de.jeanlucmakiola.calendula.ui.agenda.agendaTimeLabel import de.jeanlucmakiola.calendula.ui.common.formatTimeOfDay import de.jeanlucmakiola.floret.glance.LocalWidgetBackground import de.jeanlucmakiola.floret.glance.WidgetBackground +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import kotlinx.datetime.DateTimeUnit import kotlinx.datetime.LocalDate @@ -69,7 +70,7 @@ internal fun relativeDayLabel(context: Context, date: LocalDate, today: LocalDat val locale = widgetLocale() return relativeDayWord(context, date, today) ?: when { date < today.plus(7, DateTimeUnit.DAY) && date > today -> - date.dayOfWeek.toJavaDayOfWeek().getDisplayName(java.time.format.TextStyle.SHORT, locale) + date.dayOfWeek.toJavaDayOfWeek().getDisplayName(java.time.format.TextStyle.SHORT, locale).capitalizeStart(locale) else -> localizedDateFormatter(locale, "dMMM").format(date.toJavaLocalDate()) } } diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/agenda/AgendaWidget.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/agenda/AgendaWidget.kt index bee99ebb..ebf98686 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/agenda/AgendaWidget.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/agenda/AgendaWidget.kt @@ -55,6 +55,7 @@ import de.jeanlucmakiola.calendula.domain.hasEnded import de.jeanlucmakiola.calendula.ui.agenda.anchorTodayIfMissing import de.jeanlucmakiola.calendula.ui.common.CalendarView import de.jeanlucmakiola.calendula.ui.common.formatCalendarTitle +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import de.jeanlucmakiola.calendula.widget.widgetEventFill import de.jeanlucmakiola.calendula.ui.common.eventAccent @@ -669,7 +670,7 @@ private fun agendaDayLabel(context: Context, date: LocalDate, today: LocalDate): val java = java.time.LocalDate.of(date.year, date.month.ordinal + 1, date.day) // Weekday + date in the locale's own field order (compact: no year), rather // than a hardcoded day-month layout. - val formatted = localizedDateFormatter(locale, if (date.year == today.year) "EEEdMMM" else "EEEdMMMy").format(java) + val formatted = localizedDateFormatter(locale, if (date.year == today.year) "EEEdMMM" else "EEEdMMMy").format(java).capitalizeStart(locale) return if (relative != null) "$relative · $formatted" else formatted } @@ -681,7 +682,7 @@ private fun monthName(date: LocalDate, today: LocalDate): String = formatCalenda ) private fun weekdayShort(date: LocalDate): String = - date.dayOfWeek.toJavaDayOfWeek().getDisplayName(java.time.format.TextStyle.SHORT, widgetLocale()) + date.dayOfWeek.toJavaDayOfWeek().getDisplayName(java.time.format.TextStyle.SHORT, widgetLocale()).capitalizeStart(widgetLocale()) private fun eventTimeSummary( context: Context, diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/config/CountdownOptionsSection.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/config/CountdownOptionsSection.kt index c11d7b77..6b6f84a3 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/config/CountdownOptionsSection.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/config/CountdownOptionsSection.kt @@ -38,6 +38,7 @@ import de.jeanlucmakiola.floret.components.GroupedRow import de.jeanlucmakiola.floret.components.GroupedSectionHeader import de.jeanlucmakiola.floret.components.Position import de.jeanlucmakiola.floret.components.positionOf +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.currentLocale import de.jeanlucmakiola.floret.locale.localizedDateFormatter import kotlinx.datetime.TimeZone @@ -149,7 +150,7 @@ private fun CountdownEventPicker( val formatter = remember(locale) { localizedDateFormatter(locale, "EEEdMMMy") } LazyColumn(contentPadding = PaddingValues(top = 8.dp, bottom = 24.dp)) { itemsIndexed(matches, key = { _, it -> it.event.eventId }) { index, candidate -> - val date = formatter.format(candidate.event.start.toLocalDateTime(candidate.event.dateZone(zone)).date.toJavaLocalDate()) + val date = formatter.format(candidate.event.start.toLocalDateTime(candidate.event.dateZone(zone)).date.toJavaLocalDate()).capitalizeStart(locale) GroupedRow( title = candidate.event.title.ifBlank { stringResource(R.string.event_untitled) }, summary = if (candidate.repeats) stringResource(R.string.widget_config_countdown_repeats, date) else date, diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/date/DateWidget.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/date/DateWidget.kt index 131657df..88d13e2c 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/date/DateWidget.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/date/DateWidget.kt @@ -45,6 +45,7 @@ import de.jeanlucmakiola.floret.glance.WidgetShapedBox import de.jeanlucmakiola.floret.glance.currentRefreshStamp import de.jeanlucmakiola.floret.glance.refreshStamp import de.jeanlucmakiola.floret.glance.wallpaperBacking +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import de.jeanlucmakiola.floret.prefs.ThemeMode import kotlinx.datetime.LocalDate @@ -88,7 +89,7 @@ internal fun DateWidgetContent(today: LocalDate, appearance: WidgetAppearance, a val size = LocalSize.current val fontScale = context.resources.configuration.fontScale val side = (minOf(size.width, size.height - WeekdayLine * fontScale) - 8.dp).coerceIn(32.dp, 120.dp) - val label = localizedDateFormatter(widgetLocale(), "EEEEdMMMM").format(today.toJavaLocalDate()) + val label = localizedDateFormatter(widgetLocale(), "EEEEdMMMM").format(today.toJavaLocalDate()).capitalizeStart(widgetLocale()) val weekday = TextStyle( color = GlanceTheme.colors.onSurface, fontSize = 12.sp, diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/split/MonthDayWidget.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/split/MonthDayWidget.kt index a2e42e6e..65399bf4 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/split/MonthDayWidget.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/split/MonthDayWidget.kt @@ -83,6 +83,7 @@ import de.jeanlucmakiola.calendula.widget.widgetCardColor import de.jeanlucmakiola.calendula.widget.widgetEntryPoint import de.jeanlucmakiola.calendula.widget.widgetSettings import de.jeanlucmakiola.calendula.widget.widgetState +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import kotlinx.datetime.toJavaLocalDate import de.jeanlucmakiola.calendula.widget.widgetTimeLabel @@ -417,7 +418,7 @@ private fun DayList(day: LocalDate, data: MonthDayData.Ready, preview: Boolean) val metrics = compactRowMetrics(data.options.textSize, context.resources.configuration.fontScale) val openDay = actionStartActivity(MainActivity.openDateIntent(context, day)) Column(modifier = GlanceModifier.fillMaxSize()) { - val date = localizedDateFormatter(widgetLocale(), "EEEdMMM").format(day.toJavaLocalDate()) + val date = localizedDateFormatter(widgetLocale(), "EEEdMMM").format(day.toJavaLocalDate()).capitalizeStart(widgetLocale()) val label = when (day) { source.today, source.today.plus(1, DateTimeUnit.DAY) -> "${relativeDayLabel(context, day, source.today)} · $date" else -> date diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/today/TodayWidget.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/today/TodayWidget.kt index 3246ff40..6220158d 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/today/TodayWidget.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/today/TodayWidget.kt @@ -73,6 +73,7 @@ import de.jeanlucmakiola.floret.glance.WidgetMessage import de.jeanlucmakiola.floret.glance.currentRefreshStamp import de.jeanlucmakiola.floret.glance.refreshStamp import de.jeanlucmakiola.floret.glance.wallpaperBacking +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import de.jeanlucmakiola.floret.prefs.ThemeMode import kotlinx.datetime.DateTimeUnit @@ -251,7 +252,7 @@ private fun TodayPill(today: LocalDate) { verticalAlignment = Alignment.CenterVertically, ) { Text( - text = today.dayOfWeek.toJavaDayOfWeek().getDisplayName(JavaTextStyle.SHORT, locale), + text = today.dayOfWeek.toJavaDayOfWeek().getDisplayName(JavaTextStyle.SHORT, locale).capitalizeStart(locale), maxLines = 1, style = TextStyle(color = GlanceTheme.colors.onPrimary, fontSize = 11.sp, textAlign = TextAlign.Center), ) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/upcoming/UpcomingWidget.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/upcoming/UpcomingWidget.kt index 3687e774..ccd98173 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/upcoming/UpcomingWidget.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/upcoming/UpcomingWidget.kt @@ -60,6 +60,7 @@ import de.jeanlucmakiola.floret.glance.WidgetMessage import de.jeanlucmakiola.floret.glance.currentRefreshStamp import de.jeanlucmakiola.floret.glance.refreshStamp import de.jeanlucmakiola.floret.glance.wallpaperBacking +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.prefs.ThemeMode import kotlinx.datetime.DateTimeUnit import kotlinx.datetime.LocalDate @@ -170,12 +171,12 @@ private fun DateHeader(today: LocalDate, height: Dp) { Spacer(GlanceModifier.width(8.dp)) Column { Text( - text = today.dayOfWeek.toJavaDayOfWeek().getDisplayName(JavaTextStyle.FULL, locale), + text = today.dayOfWeek.toJavaDayOfWeek().getDisplayName(JavaTextStyle.FULL, locale).capitalizeStart(locale), maxLines = 1, style = TextStyle(color = GlanceTheme.colors.onSurface, fontSize = 13.sp, fontWeight = FontWeight.Medium), ) Text( - text = java.time.Month.of(today.month.ordinal + 1).getDisplayName(JavaTextStyle.FULL_STANDALONE, locale), + text = java.time.Month.of(today.month.ordinal + 1).getDisplayName(JavaTextStyle.FULL_STANDALONE, locale).capitalizeStart(locale), maxLines = 1, style = TextStyle(color = GlanceTheme.colors.onSurfaceVariant, fontSize = 12.sp), ) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/widget/week/WeekStripWidget.kt b/app/src/main/java/de/jeanlucmakiola/calendula/widget/week/WeekStripWidget.kt index bb4ce5b5..91bf2ec3 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/widget/week/WeekStripWidget.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/widget/week/WeekStripWidget.kt @@ -63,6 +63,7 @@ import de.jeanlucmakiola.floret.glance.WidgetMessage import de.jeanlucmakiola.floret.glance.currentRefreshStamp import de.jeanlucmakiola.floret.glance.refreshStamp import de.jeanlucmakiola.floret.glance.themedColor +import de.jeanlucmakiola.floret.locale.capitalizeStart import de.jeanlucmakiola.floret.locale.localizedDateFormatter import de.jeanlucmakiola.floret.prefs.ThemeMode import kotlinx.datetime.DateTimeUnit @@ -148,7 +149,7 @@ private fun DayTile(date: LocalDate, data: DaysWidgetData.Ready) { // A declined or cancelled event is no plan for the day, so it adds no dot and no count (#388). val events = data.eventsOn(date).filterNot { it.isCrossedOut } val colors = events.map { it.color }.distinct() - val label = localizedDateFormatter(locale, "EEEEdMMMM").format(date.toJavaLocalDate()) + val label = localizedDateFormatter(locale, "EEEEdMMMM").format(date.toJavaLocalDate()).capitalizeStart(locale) Column( modifier = GlanceModifier .fillMaxSize() @@ -164,7 +165,7 @@ private fun DayTile(date: LocalDate, data: DaysWidgetData.Ready) { verticalAlignment = Alignment.CenterVertically, ) { Text( - text = date.dayOfWeek.toJavaDayOfWeek().getDisplayName(JavaTextStyle.SHORT, locale), + text = date.dayOfWeek.toJavaDayOfWeek().getDisplayName(JavaTextStyle.SHORT, locale).capitalizeStart(locale), maxLines = 1, style = TextStyle(color = ink, fontSize = 11.sp, textAlign = TextAlign.Center), ) diff --git a/floret-kit b/floret-kit index 18fd62cf..39f668c1 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 18fd62cf0d2ed8537acca7eba77348d07f65956e +Subproject commit 39f668c13fac7c03fbdd2d5d422c82796520876e