diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/viewmodel/home/DueTrnsInfoAct.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/viewmodel/home/DueTrnsInfoAct.kt index e9ce95b125..233e521a85 100644 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/viewmodel/home/DueTrnsInfoAct.kt +++ b/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/viewmodel/home/DueTrnsInfoAct.kt @@ -1,10 +1,10 @@ package com.ivy.wallet.domain.action.viewmodel.home +import com.ivy.base.time.TimeProvider import com.ivy.data.model.Transaction import com.ivy.frp.action.FPAction import com.ivy.frp.lambda import com.ivy.frp.then -import com.ivy.legacy.utils.dateNowUTC import com.ivy.wallet.domain.action.account.AccountByIdAct import com.ivy.wallet.domain.action.exchange.ExchangeAct import com.ivy.wallet.domain.action.exchange.actInput @@ -22,14 +22,15 @@ import javax.inject.Inject class DueTrnsInfoAct @Inject constructor( private val dueTrnsAct: DueTrnsAct, private val accountByIdAct: AccountByIdAct, - private val exchangeAct: ExchangeAct + private val exchangeAct: ExchangeAct, + private val timeProvider: TimeProvider ) : FPAction() { override suspend fun Input.compose(): suspend () -> Output = suspend { range } then dueTrnsAct then { trns -> - val dateNow = dateNowUTC() + val dateNow = timeProvider.localDateNow() trns.filter { this.dueFilter(it, dateNow) } diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/RecurringRuleModal.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/RecurringRuleModal.kt index 68d759ba26..7c3a027194 100644 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/RecurringRuleModal.kt +++ b/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/RecurringRuleModal.kt @@ -33,6 +33,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.ivy.data.model.IntervalType +import com.ivy.design.api.LocalTimeProvider import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style import com.ivy.legacy.IvyWalletCtx @@ -47,7 +48,6 @@ import com.ivy.legacy.utils.hideKeyboard import com.ivy.legacy.utils.onScreenStart import com.ivy.design.utils.thenIf import com.ivy.legacy.utils.rememberInteractionSource -import com.ivy.legacy.utils.timeNowUTC import com.ivy.ui.R import com.ivy.wallet.ui.theme.Gradient import com.ivy.wallet.ui.theme.GradientIvy @@ -80,8 +80,9 @@ fun BoxWithConstraintsScope.RecurringRuleModal( dismiss: () -> Unit, onRuleChanged: (LocalDateTime, oneTime: Boolean, Int?, IntervalType?) -> Unit, ) { + val timeProvider = LocalTimeProvider.current var startDate by remember(modal) { - mutableStateOf(modal?.initialStartDate ?: timeNowUTC()) + mutableStateOf(modal?.initialStartDate ?: timeProvider.localNow()) } var oneTime by remember(modal) { mutableStateOf(modal?.initialOneTime ?: false)