From 57025e75874625efcf80c6cc40bd0bd5c88f8736 Mon Sep 17 00:00:00 2001 From: qamarelsafadi Date: Wed, 26 Jul 2023 08:40:24 +0300 Subject: [PATCH] fix: review notes --- .../apps/nowinandroid/core/ui/NewsResourceCard.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt index 9c8adaa59..50f41d8a1 100644 --- a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt +++ b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt @@ -72,6 +72,7 @@ import kotlinx.datetime.Instant import kotlinx.datetime.toJavaInstant import java.time.ZoneId import java.time.format.DateTimeFormatter +import java.time.format.FormatStyle import java.util.Locale import com.google.samples.apps.nowinandroid.core.designsystem.R as DesignsystemR @@ -157,15 +158,11 @@ fun NewsResourceHeaderImage( // TODO b/226661685: Investigate using alt text of image to populate content description contentDescription = null, // decorative image, error = { - if (LocalInspectionMode.current) { Image( painter = painterResource(DesignsystemR.drawable.ic_placeholder_default), contentDescription = "placeholder image", ) - } else { - null - } }, loading = { Box( @@ -248,8 +245,12 @@ fun dateFormatted(publishDate: Instant): String { } } - return DateTimeFormatter.ofPattern("MMM d, yyyy") - .withZone(zoneId).format(publishDate.toJavaInstant()) + return DateTimeFormatter + .ofLocalizedDate(FormatStyle.MEDIUM) + .withLocale(Locale.getDefault()) + .withZone(zoneId) + .format(publishDate.toJavaInstant()) + } @Composable