diff --git a/feature/announcement/src/main/java/io/github/droidkaigi/confsched2022/feature/announcement/Announcements.kt b/feature/announcement/src/main/java/io/github/droidkaigi/confsched2022/feature/announcement/Announcements.kt index 82547aa89..b479576d8 100644 --- a/feature/announcement/src/main/java/io/github/droidkaigi/confsched2022/feature/announcement/Announcements.kt +++ b/feature/announcement/src/main/java/io/github/droidkaigi/confsched2022/feature/announcement/Announcements.kt @@ -265,10 +265,13 @@ private fun LocalDate.convertString(): String { } else if (this.compareTo(yesterday) == 0) { stringResource(Strings.announcement_content_header_title_yesterday) } else { - "${this.year}/${this.month.value.toString().padStart(2, '0')}/${this.dayOfMonth}" + "${this.year}/${this.month.value.padDayOrMonth()}/${this.dayOfMonth.padDayOrMonth()}" } } +private fun Int.padDayOrMonth(): String = + this.toString().padStart(2, '0') + @Preview(showBackground = true) @Composable fun AnnouncementsPreview() {