From cecd7ab8ab596c652cf4b056703ed0bf680555d2 Mon Sep 17 00:00:00 2001 From: Diamond <33725716+DiamondMiner88@users.noreply.github.com> Date: Wed, 2 Nov 2022 08:05:28 -0700 Subject: [PATCH] fix: replace Instant with DateFormat for old android --- .../com/aliucord/manager/ui/viewmodel/InstallViewModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt b/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt index 036799a..5ce1e77 100644 --- a/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt +++ b/app/src/main/kotlin/com/aliucord/manager/ui/viewmodel/InstallViewModel.kt @@ -25,8 +25,8 @@ import com.github.diamondminer88.zip.* import kotlinx.coroutines.* import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.asSharedFlow +import java.text.DateFormat import java.text.SimpleDateFormat -import java.time.Instant import java.util.* import java.util.concurrent.atomic.AtomicBoolean import kotlin.time.ExperimentalTime @@ -212,12 +212,12 @@ class InstallViewModel( } } - // Download hermes & cppruntime lib + // Download hermes & c++ runtime lib val (hermesLibrary, cppRuntimeLibrary) = step(InstallStep.DL_HERMES) { // Fetch gh releases for Aliucord/Hermes val latestHermesRelease = githubRepository.getHermesReleases().fold( success = { releases -> - releases.maxBy { Instant.parse(it.createdAt) } + releases.maxBy { DateFormat.getDateTimeInstance().parse(it.createdAt) } }, fail = { throw it } ) @@ -248,7 +248,7 @@ class InstallViewModel( // Fetch the gh releases for Aliucord/AliucordNative val latestAliucordNativeRelease = githubRepository.getAliucordNativeReleases().fold( success = { releases -> - releases.maxBy { Instant.parse(it.createdAt) } + releases.maxBy { DateFormat.getDateTimeInstance().parse(it.createdAt) } }, fail = { throw it } )