File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ import kotlinx.datetime.Instant
7070import kotlinx.datetime.toJavaInstant
7171import java.time.ZoneId
7272import java.time.format.DateTimeFormatter
73+ import java.time.format.FormatStyle
7374import java.util.Locale
7475import com.google.samples.apps.nowinandroid.core.designsystem.R as DesignsystemR
7576
@@ -230,8 +231,11 @@ fun dateFormatted(publishDate: Instant): String {
230231 }
231232 }
232233
233- return DateTimeFormatter .ofPattern(" MMM d, yyyy" )
234- .withZone(zoneId).format(publishDate.toJavaInstant())
234+ return DateTimeFormatter
235+ .ofLocalizedDate(FormatStyle .MEDIUM )
236+ .withLocale(Locale .getDefault())
237+ .withZone(zoneId)
238+ .format(publishDate.toJavaInstant())
235239}
236240
237241@Composable
You can’t perform that action at this time.
0 commit comments