mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Revert a mishap in 7ff95e21ba
This commit is contained in:
parent
6bdb37be65
commit
e183cbb231
2 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import eu.kanade.domain.ui.UiPreferences
|
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.i18n.MR
|
||||||
import tachiyomi.presentation.core.i18n.stringResource
|
import tachiyomi.presentation.core.i18n.stringResource
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
|
@ -36,7 +36,7 @@ fun relativeDateText(
|
||||||
val relativeTime = remember { preferences.relativeTime().get() }
|
val relativeTime = remember { preferences.relativeTime().get() }
|
||||||
val dateFormat = remember { UiPreferences.dateFormat(preferences.dateFormat().get()) }
|
val dateFormat = remember { UiPreferences.dateFormat(preferences.dateFormat().get()) }
|
||||||
|
|
||||||
return localDate?.toRelativeSting(
|
return localDate?.toRelativeString(
|
||||||
context = context,
|
context = context,
|
||||||
relative = relativeTime,
|
relative = relativeTime,
|
||||||
dateFormat = dateFormat,
|
dateFormat = dateFormat,
|
||||||
|
|
|
@ -38,7 +38,7 @@ fun Long.toLocalDate(): LocalDate {
|
||||||
return LocalDate.ofInstant(Instant.ofEpochMilli(this), ZoneId.systemDefault())
|
return LocalDate.ofInstant(Instant.ofEpochMilli(this), ZoneId.systemDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun LocalDate.toRelativeSting(
|
fun LocalDate.toRelativeString(
|
||||||
context: Context,
|
context: Context,
|
||||||
relative: Boolean = true,
|
relative: Boolean = true,
|
||||||
dateFormat: DateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT),
|
dateFormat: DateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT),
|
||||||
|
|
Loading…
Reference in a new issue