mirror of
https://github.com/bitwarden/android.git
synced 2024-11-27 12:00:19 +03:00
Fix deletion date formatting (#704)
This commit is contained in:
parent
d706a20211
commit
0bfb9a24dc
2 changed files with 6 additions and 3 deletions
|
@ -9,12 +9,15 @@ import com.bitwarden.core.SendType
|
|||
import com.bitwarden.core.SendView
|
||||
import com.x8bit.bitwarden.R
|
||||
import com.x8bit.bitwarden.ui.platform.components.model.IconData
|
||||
import com.x8bit.bitwarden.ui.platform.util.toFormattedPattern
|
||||
import com.x8bit.bitwarden.ui.tools.feature.send.util.toLabelIcons
|
||||
import com.x8bit.bitwarden.ui.tools.feature.send.util.toOverflowActions
|
||||
import com.x8bit.bitwarden.ui.vault.feature.itemlisting.VaultItemListingState
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.toLoginIconData
|
||||
import java.time.Clock
|
||||
|
||||
private const val DELETION_DATE_PATTERN: String = "MMM d, uuuu, hh:mm a"
|
||||
|
||||
/**
|
||||
* Determines a predicate to filter a list of [CipherView] based on the
|
||||
* [VaultItemListingState.ItemListingType].
|
||||
|
@ -197,7 +200,7 @@ private fun SendView.toDisplayItem(
|
|||
VaultItemListingState.DisplayItem(
|
||||
id = id.orEmpty(),
|
||||
title = name,
|
||||
subtitle = deletionDate.toString(),
|
||||
subtitle = deletionDate.toFormattedPattern(DELETION_DATE_PATTERN, clock.zone),
|
||||
iconData = IconData.Local(
|
||||
iconRes = when (type) {
|
||||
SendType.TEXT -> R.drawable.ic_send_text
|
||||
|
|
|
@ -78,7 +78,7 @@ fun createMockDisplayItemForSend(
|
|||
VaultItemListingState.DisplayItem(
|
||||
id = "mockId-$number",
|
||||
title = "mockName-$number",
|
||||
subtitle = "2023-10-27T12:00:00Z",
|
||||
subtitle = "Oct 27, 2023, 12:00 PM",
|
||||
iconData = IconData.Local(R.drawable.ic_send_file),
|
||||
extraIconList = listOf(
|
||||
IconRes(
|
||||
|
@ -108,7 +108,7 @@ fun createMockDisplayItemForSend(
|
|||
VaultItemListingState.DisplayItem(
|
||||
id = "mockId-$number",
|
||||
title = "mockName-$number",
|
||||
subtitle = "2023-10-27T12:00:00Z",
|
||||
subtitle = "Oct 27, 2023, 12:00 PM",
|
||||
iconData = IconData.Local(R.drawable.ic_send_text),
|
||||
extraIconList = listOf(
|
||||
IconRes(
|
||||
|
|
Loading…
Reference in a new issue