From 5eb0e0d71f06e5e818053e4853ad188ea5ef3890 Mon Sep 17 00:00:00 2001 From: Kumar Rishi Date: Mon, 27 May 2024 13:00:54 +0530 Subject: [PATCH] Fixed [BUG] DATE PROBLEM #3145 occuring both in main screen and in Transaction card details (#3212) --- .../main/java/com/ivy/transaction/EditTransactionViewModel.kt | 3 ++- .../com/ivy/legacy/ui/component/edit/TransactionDateTime.kt | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt index 4cca67cd25..11505c271c 100644 --- a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt +++ b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt @@ -30,6 +30,7 @@ import com.ivy.legacy.datamodel.Account import com.ivy.legacy.datamodel.toEntity import com.ivy.legacy.domain.deprecated.logic.AccountCreator import com.ivy.legacy.utils.computationThread +import com.ivy.legacy.utils.convertUTCToLocal import com.ivy.legacy.utils.dateNowLocal import com.ivy.legacy.utils.getTrueDate import com.ivy.legacy.utils.ioThread @@ -550,7 +551,7 @@ class EditTransactionViewModel @Inject constructor( fun onSetTime(newTime: LocalTime) { loadedTransaction = loadedTransaction().copy( - time = newTime + time = newTime.convertUTCToLocal() ) time.value = newTime onSetDateTime( diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/ui/component/edit/TransactionDateTime.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/ui/component/edit/TransactionDateTime.kt index e3558bb1b2..3a58cbe441 100644 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/ui/component/edit/TransactionDateTime.kt +++ b/temp/legacy-code/src/main/java/com/ivy/legacy/ui/component/edit/TransactionDateTime.kt @@ -20,7 +20,6 @@ import androidx.compose.ui.unit.dp import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style import com.ivy.legacy.IvyWalletComponentPreview -import com.ivy.legacy.utils.convertUTCtoLocal import com.ivy.legacy.utils.formatNicely import com.ivy.legacy.utils.formatTimeOnly import com.ivy.legacy.utils.timeNowLocal @@ -80,7 +79,7 @@ fun TransactionDateTime( } ) Text( - text = " " + (dateTime?.convertUTCtoLocal()?.formatTimeOnly() ?: timeNowLocal().formatTimeOnly()), + text = " " + (dateTime?.formatTimeOnly() ?: timeNowLocal().formatTimeOnly()), style = UI.typo.nB2.style( color = UI.colors.pureInverse, fontWeight = FontWeight.ExtraBold