mirror of
https://github.com/dotnetfactory/fluid-calendar.git
synced 2026-03-02 22:57:19 -05:00
Incorrect Timezone Handling in CalDAV Event Creation #99
Labels
No labels
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fluid-calendar#99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Passthem-desu on GitHub (Jun 18, 2025).
Description:
I'm experiencing an issue with Fluid Calendar where events created within the application are displayed incorrectly in other calendar applications like Thunderbird and Home Assistant. Specifically, these events are shifted by 8 hours. Events created in other applications, however, display correctly in Fluid Calendar.
I'm currently using the application in the Asia/Shanghai (UTC+8) timezone.
I've investigated the generated CalDAV files to understand the discrepancy. Here's a VEVENT created in Fluid Calendar that exhibits the incorrect behavior:
In Fluid Calendar's web interface, this event correctly displays from 17:30 to 19:30 (Asia/Shanghai timezone). However, in other applications, it incorrectly shows as 9:30 to 11:30.
For comparison, here's an example of a correctly behaving event (created in Thunderbird) that displays accurately in both Fluid Calendar and Thunderbird:
Crucially, the
DTSTARTandDTENDproperties in the correct event are explicitly marked withTZID=Asia/Shanghai. This suggests a potential issue with how Fluid Calendar handles timezones during event creation.Possible Solution:
The
DTSTARTvalue "20250619T093000" in the problematic event lacks a "Z" suffix. According to the W3C specification on Floating Time this indicates that the time is to be interpreted as "floating" or "local time." This means it could be 17:30 in UTC+8 (Asia/Shanghai) or 9:30 in UTC (which might be the server's timezone), explaining why it's handled correctly in the web UI.However, other calendar applications may not interpret this "floating time" correctly when their local timezone differs from the server's, leading to the observed 8-hour shift.
Therefore, a robust solution would be to explicitly mark event times with the local timezone using the
TZIDproperty. This would ensure clarity and consistent interpretation of event times across all applications, regardless of their local timezone settings.@Passthem-desu commented on GitHub (Jun 18, 2025):
Oh, here's a workaround by adding "TZ=Asia/Shanghai" into the environment file. However, the issue still affects those who want to collaborate in different timezones...
@shuperluu commented on GitHub (Jun 27, 2025):
Could this be the reason why I cannot create All day events but can create events that goes from 00:00 to 24:00?
@cboy60 commented on GitHub (Sep 10, 2025):
I was having a similar issue — my event times were off by 4 hours, which I believe shares the same root cause described here.
I tried setting TZ=America/New_York both in my .env file and explicitly under the environment section of my docker-compose.yaml, but the issue persisted. To debug, I ran:
docker exec -it date
This returned a UTC time, whereas I expected EDT, given the TZ setting. That suggested the container wasn't respecting the timezone config.
The workaround I found was to create a custom Dockerfile that installs tzdata explicitly:
FROM eibrahim/fluid-calendar:latest
USER root
RUN apk add --no-cache tzdata
ENV TZ=America/New_York
USER nextjs
Then I built the image locally:
docker build -t my-fluid-calendar-custom .
And updated my Compose file to use this local image. After doing that, the time inside the container reflected the correct timezone, and events created in FluidCalendar now show the correct time in third-party CalDAV clients.
Not an ideal long-term fix, since it requires rebuilding the image for any upstream updates, but it's working for now. Hopefully this helps others hitting the same issue.
@shuperluu commented on GitHub (Sep 17, 2025):
I don't have enough knowledge to manipulate thigs like that or try to submit a PR.
@eibrahim Any chance you look into this for a next release?