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

Aperta
#732 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, docker
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).
Lingua principale
C#
Stelle
2.4k
Fork
121
Merge medio
18g 20h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di immichFrame/ImmichFrame

Tutte le issue di immichFrame/ImmichFrame

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.