FossifyOrg / Calendar

A simple calendar with events, customizable widgets and no ads.
https://www.fossify.org
GNU General Public License v3.0
688 stars 56 forks source link

Wrong time by importing ICS files with offset #262

Open juantxorena opened 3 months ago

juantxorena commented 3 months ago

Checklist

Affected app version

1.0.3

Affected Android/Custom ROM version

Android 14

Affected device model

Pixel 8

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

  1. Import the following ics file. The event is at 09:30:
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//hacksw/handcal//NONSGML v1.0//EN
    BEGIN:VEVENT
    DTSTART:20240628T093000
    DTEND:20240628T100000
    SUMMARY:Ihr Termin mit *****
    LOCATION: ***** , 
    END:VEVENT
    END:VCALENDAR
    BEGIN:VTIMEZONE
    TZID:W. Europe Standard Time
    BEGIN:STANDARD
    RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE

Expected behavior

The event should be created at 09:30

Actual behavior

The event is created at 11:30

Screenshots/Screen recordings

No response

Additional information

This works on google calendar, Etar, and version 1.0.2. There is actually a closed related bug #71, I commented there, but no answer, probably because it's already closed.

The problem seems to be that after that fix, it always considers the timezone of the file, but in this case, the date of the event is, as per the specs, a "floating" datetime, which means it should be created at the time in DTSTART, ignoring any timezone information (i.e. as it worked before that fix).

danmou commented 3 months ago

I had the same problem with this ics file (which caused me to miss my dentist appointment 😅):

VERSION:2.0
BEGIN:VEVENT
UID:***
DTSTAMP:20240628T092710
DTSTART:20240703T113000
DTEND:20240703T120000
SUMMARY:***
DESCRIPTION:
LOCATION:***
END:VEVENT
END:VCALENDAR

It should be at 11:30 but was inserted at 13:30.

a-jackson commented 2 months ago

I've had the same. It seems to interpret the time as UTC rather than local. I've had other ics files where the timestamp is in UTC with a Z at the end and it handles that correctly. Importing the ics file to a couple of other apps (Outlook and Nextcloud Calendar) they treat it as local time as expected.

kroerig commented 2 months ago

Same problem here.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//tvticket/handcal//NONSGML v1.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
LOCATION:*********
DESCRIPTION:***********
DTSTART:20240811T204500
DTEND:20240811T210000
SUMMARY:********
URL;VALUE=URI:https://tvtickets.de
DTSTAMP:20240719T071413
UID:669a124565101
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION: Erinnerung an Terminbestätigung der Tickets
TRIGGER:-P3D
END:VALARM
END:VEVENT
END:VCALENDAR

Because of the missing Z at the end of DTSTART and DTEND the string has to be considerd as local time and not Zulu Time (UTC).

sebastian0119 commented 1 month ago

Same here and I think it is related to what I reported some time ago (#216 )