finance-tracker
finance-tracker copied to clipboard
Transactions without time information show up on the wrong date after switching timezones
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 :(
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".