ivy-wallet
ivy-wallet copied to clipboard
[BUG] Transaction being added to the wrong date after changing time (timezone issue)
Please confirm the following
- [X] I checked the current issues for duplicate problems
Describe the bug
Al querer configurar la hora en los registros de gastos e ingresos, si selecciono una hora después de las 6:00pm lo marca automáticamente como si la transacción se hubiera hecho el día siguiente.
To Reproduce
- Agregar gasto.
- Seleccionar cuenta.
- Ingresar monto.
- Clic en botón "Ingresar".
- Seleccionar categoría.
- Ingresar título del gasto.
- Configurar el día en el calendario.
- Configurar hora.
- Si la hora es después de las 18:00 aparece el bug, ya que la transacción se convierte y queda en la fecha del día siguiente y no en el seleccionado.
Expected behavior
Que la hora y fecha queden como debe ser de acuerdo a lo configurado. Este bug no ocurría en la versión anterior.
Screenshots
App version
4.6.2 from Google Play Store for Android
Smartphone
Xiaomi Redmi Note 10S
Additional context
No response
Thank you @rekcrimson for raising Issue #3118! 🚀 What's next? Read our Contribution Guidelines 📚.
Tagging @ILIYANGERMANOV for review & approval 👀
Hello @rekcrimson thanks for reporting! Would you translate it to English? I don't understand Spanish and also most contributors won't be able to
I can reproduce the issue as well. In short try the following to reproduce the issue: Add an expense, set any value and jump to the datetime control. It shows 10 Apr but after changing only the time e.g. to 6pm the date jumps to 11 Apr. The expense is then saved with date 11 Apr and not 10 Apr as intended. @rekcrimson screenshots show the issue
Btw, is there any chance to get 24h clock back instead of 12 hour clock? Had the 24h clock until the new update
Thanks for translating @faerbersteve! Can you create an separate issue for the 12/24 clock to be shown depending on user's Android system settings?
It's timezones issues. We don't treat transactions time properly.
I'm on it
Thank you for your interest @ILIYANGERMANOV! 🎉 Issue #3118 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.
@ILIYANGERMANOV I want to work on this, Can you give me an idea how we want to solve this problem? How do you want to save time etc, what will be the impact of change on other functionalities?
Hey @Vivekban yes, here's how to fix it:
- Change TransactionsEntity and DB time to
Instant - Convert Instant to formatted local datetime only in the UI layer
- Add a
FormatTimeUseCasein ":shared:ui:core" that turns an Instant (UTC) to formatted String in local time - Update VM's to use the new use-case
Logic:
- Everything in the DB and domain logic is in UTC (Instant) => no time zones
- When all computations are done the UI layer converts the UTC time into user's local
- Note: You might also need to update the Date/Time pickers
Does that helps?
I'm on it
Thank you for your interest @Vivekban! 🎉 Issue #3118 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.
Should be fixed in https://github.com/Ivy-Apps/ivy-wallet/pull/3224