Allow events stored in localtime #35

Closed
opened 2026-07-23 01:46:10 +02:00 by wireva · 0 comments
Owner

I really hate the idea of this, but at least recurring events kind of require local time.

At least at the time of creation. So when creating an event, we must allow (and probably standardize) sending the timestamp as localtime. The recurring events creator can then iterate on localtime (might be a bit more complex than that, think "repeat every day at 9am", adding 24 hours will shift.)

Preferably, I would like all times in the database to remain in UTC. However, this may be unpractical.

What if I create an event at 9 am in two years, but in one year it is decided that daylight saving time is no more? the event would then be at 8/10am, which is probably not intended behaviour.

So we will have to change all the dates to be stored in localtime and store the TZID with them. Fun.

  • Remove end time from database, replace with duration. This is easier to deal with overall and while we are it, might as well.
  • Introduce a field start_time_local and tzid, remove start_time.
  • Add a field start_time_utc_cached and tzdb_version
  • On app startup, recompute all start_time_utc_cached where tzdb_version is not latest.
  • Fix the bazillion issues this will create.
~~I really hate the idea of this, but at least recurring events kind of require local time.~~ ~~At least at the time of creation. So when creating an event, we must allow (and probably standardize) sending the timestamp as localtime. The recurring events creator can then iterate on localtime (might be a bit more complex than that, think "repeat every day at 9am", adding 24 hours will shift.)~~ Preferably, I would like all times in the database to remain in UTC. However, this may be unpractical. What if I create an event at 9 am in two years, but in one year it is decided that daylight saving time is no more? the event would then be at 8/10am, which is probably not intended behaviour. So we will have to change all the dates to be stored in localtime and store the TZID with them. Fun. - [ ] Remove end time from database, replace with duration. This is easier to deal with overall and while we are it, might as well. - [ ] Introduce a field start_time_local and tzid, remove start_time. - [ ] Add a field start_time_utc_cached and tzdb_version - [ ] On app startup, recompute all start_time_utc_cached where tzdb_version is not latest. - [ ] Fix the bazillion issues this will create.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
wireva/calunder#35
No description provided.