Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ class DateFormatter(

// less than 1h
span < ONE_HOUR_IN_MILLIS -> {
context.getString(
R.string.date_formatting_relative_minutes,
span / ONE_MINUTE_IN_MILLIS
)
context.resources
.getQuantityString(
R.plurals.date_formatting_relative_minutes,
span.toInt() / ONE_MINUTE_IN_MILLIS
)
}

// less than 1d
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
<!-- relative time less than 1 minute using the term: Now -->
<string name="date_formatting_now">Now</string>
<!-- relative time in minutes, less than 1 hour, i.e. 1m, 5m, 59m -->
<string name="date_formatting_relative_minutes">%dm</string>
<plurals name="date_formatting_relative_minutes">
<item quantity="one">%dm</item>
<item quantity="other">%dm</item>
</plurals>
<!-- relative time in hours, less than 1 day, i.e. 1h, 5h, 23h -->
<plurals name="date_formatting_relative_hours">
<item quantity="one">%dh</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DateFormatterTest {
val calendar = Calendar.getInstance()
calendar.add(Calendar.MINUTE, -5)
val formattedDate = dateFormatter.getConditionallyRelativeFormattedTimeSpan(calendar)
val expected = context.getString(R.string.date_formatting_relative_minutes, 5)
val expected = context.resources.getQuantityString(R.plurals.date_formatting_relative_minutes, 5)
assertEquals(expected, formattedDate)
}

Expand Down
2 changes: 1 addition & 1 deletion ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
kapt "org.jetbrains.kotlin:kotlin-metadata-jvm:${kotlinVersion}"

implementation(platform("androidx.compose:compose-bom:2026.06.01"))
implementation(platform("androidx.compose:compose-bom:2026.08.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.material3:material3")
Expand Down
Loading