diff --git a/android/composeui/src/main/java/com/stadiamaps/ferrostar/composeui/formatting/DateTimeFormatter.kt b/android/composeui/src/main/java/com/stadiamaps/ferrostar/composeui/formatting/DateTimeFormatter.kt index 020fe50f..8576731c 100644 --- a/android/composeui/src/main/java/com/stadiamaps/ferrostar/composeui/formatting/DateTimeFormatter.kt +++ b/android/composeui/src/main/java/com/stadiamaps/ferrostar/composeui/formatting/DateTimeFormatter.kt @@ -1,6 +1,7 @@ package com.stadiamaps.ferrostar.composeui.formatting import android.icu.util.ULocale +import java.time.format.FormatStyle import java.util.Locale import kotlinx.datetime.LocalDateTime import kotlinx.datetime.toJavaLocalDateTime @@ -11,12 +12,11 @@ interface DateTimeFormatter { class EstimatedArrivalDateTimeFormatter( private var localeOverride: ULocale? = null, + private val unitStyle: FormatStyle = FormatStyle.SHORT ) : DateTimeFormatter { override fun format(dateTime: LocalDateTime): String { val locale = localeOverride?.let { Locale(it.language, it.country) } ?: Locale.getDefault() - val formatter = - java.time.format.DateTimeFormatter.ofLocalizedTime(java.time.format.FormatStyle.SHORT) - .withLocale(locale) + val formatter = java.time.format.DateTimeFormatter.ofLocalizedTime(unitStyle).withLocale(locale) return formatter.format(dateTime.toJavaLocalDateTime()) } } diff --git a/android/core/src/main/java/com/stadiamaps/ferrostar/core/NavigationViewModel.kt b/android/core/src/main/java/com/stadiamaps/ferrostar/core/NavigationViewModel.kt index 7dbd9121..86a6448b 100644 --- a/android/core/src/main/java/com/stadiamaps/ferrostar/core/NavigationViewModel.kt +++ b/android/core/src/main/java/com/stadiamaps/ferrostar/core/NavigationViewModel.kt @@ -104,7 +104,7 @@ interface NavigationViewModel { * interface that is reused across navigation sessions will probably need to craft their own view * model. */ -class DefaultNavigationViewModel( +open class DefaultNavigationViewModel( private val ferrostarCore: FerrostarCore, private val annotationPublisher: AnnotationPublisher<*> = NoOpAnnotationPublisher() ) : ViewModel(), NavigationViewModel {