PM-19593: Update expiration string to be 'Expires on <date>' (#5069)

This commit is contained in:
David Perez
2025-04-16 13:56:34 -05:00
committed by GitHub
parent d67e74e48b
commit 4f65044179
4 changed files with 6 additions and 7 deletions

View File

@@ -12,7 +12,6 @@ import kotlinx.collections.immutable.toImmutableList
import java.time.Clock
import java.time.Instant
import java.time.temporal.ChronoUnit
import kotlin.time.Duration.Companion.milliseconds
/**
* Converts a set of [FlightRecorderDataSet] to a [RecordedLogsState.ViewState].
@@ -74,9 +73,9 @@ private fun FlightRecorderDataSet.FlightRecorderData.expiresIn(clock: Clock): Te
// We expire tomorrow based on the day of year.
R.string.expires_tomorrow.asText()
} else {
// Let them know how many days they have left.
val millisRemaining = expirationTime.minusMillis(now.toEpochMilli()).toEpochMilli()
R.string.expires_in_days.asText(millisRemaining.milliseconds.inWholeDays)
// Let them know the date it expires.
val expirationDate = expirationTime.toFormattedPattern(pattern = "M/d/yy", clock = clock)
R.string.expires_on.asText(expirationDate)
}
}

View File

@@ -622,7 +622,7 @@ Scanning will happen automatically.</string>
<string name="expired">Expired</string>
<string name="expires_at">Expires at %s</string>
<string name="expires_tomorrow">Expires tomorrow</string>
<string name="expires_in_days">Expires in %s days</string>
<string name="expires_on">Expires on %s</string>
<string name="stops_logging_on">Stops logging on %1$s at %2$s</string>
<string name="maximum_access_count">Maximum access count</string>
<string name="maximum_access_count_info">If set, users will no longer be able to access this Send once the maximum access count is reached.</string>

View File

@@ -114,7 +114,7 @@ class RecordedLogsScreenTest : BaseComposeTest() {
id = "52",
title = "2025-04-12T03:15:00 2025-04-12T04:15:00".asText(),
subtextStart = "1.00 KB".asText(),
subtextEnd = R.string.expires_in_days.asText("30"),
subtextEnd = R.string.expires_on.asText("4/12/25"),
isDeletedEnabled = true,
),
),

View File

@@ -117,7 +117,7 @@ class FlightRecorderDataSetExtensionsTest {
id = "52",
title = "2025-04-12T08:15:00 2025-04-12T09:15:00".asText(),
subtextStart = "1.00 KB".asText(),
subtextEnd = R.string.expires_in_days.asText(30L),
subtextEnd = R.string.expires_on.asText("5/11/25"),
isDeletedEnabled = true,
),
RecordedLogsState.DisplayItem(