diff --git a/packages/core-mobile/app/screens/earn/Confirmation/Confirmation.tsx b/packages/core-mobile/app/screens/earn/Confirmation/Confirmation.tsx index 09196ae2e5..d201b174ff 100644 --- a/packages/core-mobile/app/screens/earn/Confirmation/Confirmation.tsx +++ b/packages/core-mobile/app/screens/earn/Confirmation/Confirmation.tsx @@ -90,6 +90,9 @@ export const Confirmation = (): JSX.Element | null => { const { minStartTime, validatedStakingEndTime, validatedStakingDuration } = useValidateStakingEndTime(stakingEndTime, validatorEndTimeUnix) + const localValidatedStakingEndTime = useMemo(() => { + return new Date(validatedStakingEndTime.getTime()) + }, [validatedStakingEndTime]) const { data } = useEarnCalcEstimatedRewards({ amount: deductedStakingAmount, @@ -349,7 +352,7 @@ export const Confirmation = (): JSX.Element | null => { {getReadableDateDuration(validatedStakingEndTime)} - {format(validatedStakingEndTime, 'MM/dd/yy H:mm aa')} + {format(localValidatedStakingEndTime, 'MM/dd/yy H:mm aa')} diff --git a/packages/core-mobile/app/services/wallet/WalletService.tsx b/packages/core-mobile/app/services/wallet/WalletService.tsx index c68f90b64a..2fb794eedc 100644 --- a/packages/core-mobile/app/services/wallet/WalletService.tsx +++ b/packages/core-mobile/app/services/wallet/WalletService.tsx @@ -22,7 +22,7 @@ import { Account } from 'store/account/types' import { RpcMethod } from 'store/rpc/types' import Logger from 'utils/Logger' import { UnsignedTx, utils } from '@avalabs/avalanchejs' -import { fromUnixTime, getUnixTime } from 'date-fns' +import { getUnixTime } from 'date-fns' import { getMinimumStakeEndTime } from 'services/earn/utils' import { Avax } from 'types/Avax' import { bnToBigint } from 'utils/bigNumbers/bnToBigint' @@ -30,6 +30,7 @@ import { SeedlessPubKeysStorage } from 'seedless/services/storage/SeedlessPubKey import SeedlessWallet from 'seedless/services/wallet/SeedlessWallet' import { PChainId } from '@avalabs/glacier-sdk' import { MessageTypes, TypedData, TypedDataV1 } from '@avalabs/vm-module-types' +import { UTCDate } from '@date-fns/utc' import { isAvalancheTransactionRequest, isBtcTransactionRequest } from './utils' import WalletInitializer from './WalletInitializer' import WalletFactory from './WalletFactory' @@ -533,7 +534,7 @@ class WalletService { const minimalStakeEndDate = getMinimumStakeEndTime( isDevMode, - fromUnixTime(startDate) + new UTCDate(startDate * 1000) ) if (endDate < getUnixTime(minimalStakeEndDate)) {