Calendar: recurring events show their series start date, and the "today" window starts at midnight UTC

Open
#732 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, docker
Domain
backend

Research direction

Read CalendarExtensionMethods.ToAppointment(Occurrence) and IcalCalendarService.GetAppointments(); the issue identifies both affected paths and the expected local-day behavior. Check how occurrence periods supply appointment dates, then inspect how the calendar query window gets its time zone. Done when recurring events use their occurrence dates and the results include only events overlapping the container’s local day.

Written by the indexing model from the issue text.

Description

Version

v1.0.39.0

Deployment Method

Docker (ghcr.io/immichframe/immichframe:latest) on Unraid, TZ=America/Chicago. Calendar is a Google Calendar secret iCal URL.

Description

There are two problems in the calendar widget. Both show up with an ordinary Google Calendar feed.

1. Recurring events show the date of their first occurrence, not today's.
GetOccurrences() correctly finds the recurring events that happen today. But CalendarExtensionMethods.ToAppointment(Occurrence) hands off to ToAppointment(CalendarEvent), which builds the appointment from calEvent.Start / calEvent.End. Those are the series' original DTSTART / DTEND, not this occurrence's occurrence.Period. So a yearly birthday first entered in 2022 shows a 2022 date and weekday, and a bi-weekly event first entered in 2023 shows a date from 2023.

2. Events from the previous evening show as "today".
IcalCalendarService.GetAppointments() calls calendar.GetOccurrences(DateTime.Today, DateTime.Today.AddDays(1)). With Ical.Net 4.3.1, the window seems to be read as UTC midnight to UTC midnight. For a UTC−6 time zone, that means 6:00 pm yesterday to 6:00 pm today. So any event after 6 pm the evening before appears in today's list, and events after 6 pm today are missing.

Reproduction

Container TZ=America/Chicago, checked on 2026-11-06 at about 3:30 pm CST (docker exec immichFrame date → CST).

Calendar feed contains:

BEGIN:VEVENT
DTSTART;VALUE=DATE:20221106
DTEND;VALUE=DATE:20221107
RRULE:FREQ=YEARLY
SUMMARY:Birthday
END:VEVENT
BEGIN:VEVENT
DTSTART;VALUE=DATE:20230721
DTEND;VALUE=DATE:20230722
RRULE:FREQ=WEEKLY;INTERVAL=2
SUMMARY:Payday
END:VEVENT
BEGIN:VEVENT
DTSTART:20261106T014500Z
DTEND:20261106T024500Z
SUMMARY:Appointment
END:VEVENT

(The last event is 2026-11-05 at 7:45 pm CST, which is yesterday evening.)

GET /api/Calendar returns:

[{"startTime":"2022-11-06T00:00:00-05:00","endTime":"2022-11-07T00:00:00-06:00","summary":"Birthday"},
 {"startTime":"2023-07-21T00:00:00-05:00","endTime":"2023-07-22T00:00:00-05:00","summary":"Payday"},
 {"startTime":"2026-11-05T19:45:00-06:00","endTime":"2026-11-05T20:45:00-06:00","summary":"Appointment"}]

The frame then shows the birthday on Nov 6, 2022, a Sunday, even though today is Friday, Nov 6, 2026. When the container was accidentally running in UTC, the same entry rendered as "Saturday, Nov 5". The appointment from yesterday evening is listed as today.

Expectations
  • Recurring events should show the occurrence's own start and end, 2026-11-06 for the birthday and payday above.
  • Only events that overlap the current local day (midnight to midnight in the container's TZ) should be listed.

Possible fixes, untested:

  • In ToAppointment(Occurrence), take Summary, Description and Location from the source CalendarEvent, but take StartTime, EndTime and Duration from occurrence.Period.
  • Pass a time-zone-aware window to GetOccurrences, e.g. new CalDateTime(DateTime.Today, TimeZoneInfo.Local.Id). That keeps it from being read as UTC.
Configuration

Relevant settings only:

"Webcalendars": ["https://calendar.google.com/calendar/ical/<id>/private-<token>/basic.ics"]

All other settings are left at their defaults.

Logs

There are no errors. The calendar loads successfully; the only problem is the dates.

Pre-Submission Checklist
  • This is a bug report and not a feature request
  • I have provided all of the required information to reproduce the bug (config, logs, etc.)
  • I have checked for related issues and checked the documentation. Related but separate: #695 (configurable look-ahead) and #589 (switched the search to DateTime.Today).
Dominant language
C#
Stars
2.4k
Forks
121
Avg merge
18d 20h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from immichFrame/ImmichFrame

All issues in immichFrame/ImmichFrame

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.