ivy-wallet icon indicating copy to clipboard operation
ivy-wallet copied to clipboard

[BUG] when I have an unlisted account (not counted towards total balance), the date of my transaction changes to the next day

Open bharoar opened this issue 1 year ago • 9 comments

Please confirm the following

Describe the bug

when I have an unlisted account (not counted towards total balance), the date of my transaction changes to the next day

To Reproduce

  1. have an unlisted account
  2. create transaction (expense)
  3. transaction date displayed is of tomorrow

Expected behavior

the date of the transaction shouldve reflected the transaction input period

Screenshots

No response

App version

v2024.07.28-192

Smartphone

Samsung S21 FE

Additional context

No response

bharoar avatar Jul 30 '24 14:07 bharoar

Revision To Recreate Step:

  1. Have Unlisted/Excluded Account
  2. Create transaction (expense)
  3. Confirm and save transaction
  4. Transaction date recorded as tomorrow

bharoar avatar Jul 30 '24 14:07 bharoar

Thank you @bharoar for raising Issue #3383! 🚀 What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

ivywallet avatar Jul 30 '24 14:07 ivywallet

I'm on it

viratde avatar Aug 05 '24 07:08 viratde

Thank you for your interest @viratde! 🎉 Issue #3383 is assigned to you. You can work on it! ✅

If you don't want to work on it now, please un-assign yourself so other contributors can take it.

Also, make sure to read our Contribution Guidelines.

ivywallet avatar Aug 05 '24 07:08 ivywallet

@bharoar Could you please share the screenshot of the process to reproduce the issue? I am not able to reproduce it

viratde avatar Aug 05 '24 07:08 viratde

@bharoar Could you please share the screenshot of the process to reproduce the issue? I am not able to reproduce it

@viratde try changing the timezone of your device to some weird one (e.g. +12 or -12l

ILIYANGERMANOV avatar Aug 05 '24 07:08 ILIYANGERMANOV

@ILIYANGERMANOV Thanks got it

viratde avatar Aug 05 '24 07:08 viratde

@bharoar Could you please share the screenshot of the process to reproduce the issue? I am not able to reproduce it

@viratde try changing the timezone of your device to some weird one (e.g. +12 or -12l

Hey @ILIYANGERMANOV, The error is in the file RootActivity.kt line 198, and the error is because the time picker dialog is allowing the user to select a time in his timezone while that onTimePicked function is returning time in UTC.

There can be two solutions to this:-

  1. We store the time in the local timezone so that I can remove the function convertLocalToUtc from Rootactivity. kt file.
  2. We store the time in UTC. but wherever we show the date to the user, we refactor the date and time to the local timezone . But this refactoring will be needed all over the app codebase. image

I just wanted to ask. Which one I should follow?

viratde avatar Aug 06 '24 06:08 viratde

The proper fix would be:

  1. Store everything in UTC
  2. Only the UI layer will present local time (and convert local back to UTC when needed)

Use the TimeConverter API that I recently merged. We also need to create TimeFormatter in :shared:ui` following the same pattern

ILIYANGERMANOV avatar Aug 06 '24 07:08 ILIYANGERMANOV