finance-tracker icon indicating copy to clipboard operation
finance-tracker copied to clipboard

Transactions without time information show up on the wrong date after switching timezones

Open Bone008 opened this issue 2 years ago • 1 comments

When moving from e.g. UTC+2 to UTC+1, all transactions that were created with time 0:00 in UTC+2 now show up with time 23:00 on the previous day, indicating a wrong date.

It is unclear how this should be detected/fixed and how easy it is to fix post-hoc :(

Bone008 avatar Aug 18 '22 20:08 Bone008

Introduced realDate field and started filling it for new transactions.

It isn't used for display/calculations yet, but the idea is that we actually still not really support time components in transaction dates in the UI. And they are unavailable for imported transactions anyway.

For manually created ones that you create "in the moment" without changing the date, you can still reconstruct the time of day from the created timestamp.

So eventual goal: Phase out timestamp-based transaction dates completely, use created field for sorting and date arithmetic for everything else.

For this we need to backfill realDate into old transactions in a timezone-proof manner. Idea: check for timestamp % 1800 === 0 and round to "nearest to midnight".

Bone008 avatar Oct 04 '23 23:10 Bone008