From 1e28999e1387c47080d2dc868021b3f257e5325e Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 17 Feb 2024 03:28:48 +0600 Subject: [PATCH] Revert a mishap in 7ff95e21babda98dd1b479912278d6029cd15f0d --- .../main/java/eu/kanade/presentation/components/DateText.kt | 4 ++-- .../main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/components/DateText.kt b/app/src/main/java/eu/kanade/presentation/components/DateText.kt index 59708a049..4f2d988af 100644 --- a/app/src/main/java/eu/kanade/presentation/components/DateText.kt +++ b/app/src/main/java/eu/kanade/presentation/components/DateText.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext import eu.kanade.domain.ui.UiPreferences -import eu.kanade.tachiyomi.util.lang.toRelativeSting +import eu.kanade.tachiyomi.util.lang.toRelativeString import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import uy.kohesive.injekt.Injekt @@ -36,7 +36,7 @@ fun relativeDateText( val relativeTime = remember { preferences.relativeTime().get() } val dateFormat = remember { UiPreferences.dateFormat(preferences.dateFormat().get()) } - return localDate?.toRelativeSting( + return localDate?.toRelativeString( context = context, relative = relativeTime, dateFormat = dateFormat, diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt index e1a1ea62f..9e61555ec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt @@ -38,7 +38,7 @@ fun Long.toLocalDate(): LocalDate { return LocalDate.ofInstant(Instant.ofEpochMilli(this), ZoneId.systemDefault()) } -fun LocalDate.toRelativeSting( +fun LocalDate.toRelativeString( context: Context, relative: Boolean = true, dateFormat: DateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT),