Skip to content

Conversation

@adrcotfas
Copy link

@adrcotfas adrcotfas commented Nov 7, 2025

Hello there,

Some context:

  • I'm migrating a project from Android Compose to Compose Multiplatform
  • On Android I was using java.time.Month.getDisplayName and java.time.DayOfWeek.getDisplayName and I miss that functionality
  • I've added some logic here to retrieve the localized names on jvm and darwin targets using a Locale and a java.time.format.TextStyle inspired TextStyle.

I've added DayOfWeekNames.ENGLISH_NARROW and MonthNames.ENGLISH_NARROW to use together with the ENGLISH_FULL and ENGLISH_ABBREVIATED as fallback for displayName.
These were defined as List<String> because could contain duplicate entries, to not accidentally pass them to the DateTimeFormatBuilder which currently expects different entries for day/month names.

I'm looking forward to your feedback and in the meantime I'll be using this: https://github.com/adrcotfas/kotlinx-datetime-names (there's a demo there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant