Libraries not loading correctly

Created on 26 February 2024, 9 months ago

Problem/Motivation

The Date iCal doesn't seem to handle the iCalcreator library well. When exporting calendar items through views (as described in the readme), all dates are exported in UTC (my site and date fields are set to CET).

Steps to reproduce

Drupal 10.2.2
Date Ical 4.0.5
Put iCalcreator files (2.20.7) in [D10 root]/libraries/iCalcreator
Create a content type with date field
Setup export as ics
Import ics to calendar app, all dates are offset 1 hour.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.0

Component

iCal Export

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @robbe03
  • 🇫🇷France lazzyvn paris

    It's strange that in version 4 there is nothing related to libraries, don't mix with verrsion 7.x. you have to install using composer, it will install the library in vendor.
    Regarding date field I think it will convert all date strings to UTC format before passing to the ical library to generate their format . I think you can customize the field's date format in the view.

  • Okay, that makes sense. However, the README file in the 4.x-versions is a bit misleading.

    It appears that the time zone definition is not handled correctly. My site's time zone is Brussels and all meetings are formatted in Brussels timezone.

    In the heading of my .ics (generated by Date iCal), the time zone is defined as follows:

    TZID:Europe/Brussels
    TZUNTIL:20251026T010000Z
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:20231029T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RDATE:20241027T030000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:20230326T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RDATE:20240331T020000
    RDATE:20250330T020000
    END:DAYLIGHT
    END:VTIMEZONE
    

    However, when I chance this time zone definition to a more general apporach (using rules), I get the correct times in my calendar app:

    BEGIN:VTIMEZONE 
    TZID:Europe/Brussels 
    X-LIC-LOCATION:Europe/Brussels 
    BEGIN:DAYLIGHT 
    TZOFFSETFROM:+0100 
    TZOFFSETTO:+0200 
    TZNAME:CEST 
    DTSTART:19700329T020000 
    RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU 
    END:DAYLIGHT BEGIN:STANDARD 
    TZOFFSETFROM:+0200 
    TZOFFSETTO:+0100 
    TZNAME:CET 
    DTSTART:19701025T030000 
    RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU 
    END:STANDARD 
    END:VTIMEZONE
    

    Is this a Date iCal issure, or rather something to do with iCalcreator?

  • I am facing the same issue, when imported, it uses UTC instead of the local timezone.

    I have tried tinkering timezone overrides with the field displays and in the view, but it doesn't fix the issue.

    Drupal 10.2.4
    Date iCal 4.0.6

  • I tried importing the above ics and added Z at the end of lines below and issues seems fixed.

    DTSTART;TZID=America/Vancouver:20240406T000000Z
    DTEND;TZID=America/Vancouver:20240406T010000Z

  • 🇫🇷France mchamps Finistère

    Same issue
    Drupal 10.2.5
    Date iCal 4.0.6

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//https://d10-dev.goodtimesdilding.com//NONSGML iCalcreator 2.41.90//
    CALSCALE:GREGORIAN
    METHOD:PUBLISH
    UID:33363336-6662-4364-b365-623266633066
    X-WR-RELCALID:fd2a130b-361c-45b9-9e27-f6aaaf33e6a0
    X-WR-TIMEZONE:Europe/Paris
    X-WR-CALNAME:Calendrier Public
    BEGIN:VTIMEZONE
    TZID:Europe/Paris
    TZUNTIL:20261025T010000Z
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:20231029T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RDATE:20241027T030000
    RDATE:20251026T030000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:20240331T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RDATE:20250330T020000
    RDATE:20260329T020000
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    UID:787791b7-f275-4371-a6c3-fa13e6658e33
    DTSTAMP:20240430T001520Z
    CLASS:PUBLIC
    CREATED:20240429T231643Z
    DESCRIPTION:Occupé
    DTSTART;TZID=Europe/Paris:20240429T220000
    DTEND;TZID=Europe/Paris:20240430T220000
    LAST-MODIFIED:20240429T231643Z
    SEQUENCE:1
    SUMMARY:Occupé
    TRANSP:OPAQUE
    END:VEVENT
    BEGIN:VEVENT
    UID:0cb5cf8b-a2c1-46ad-babd-e0deb38827ac
    DTSTAMP:20240430T001520Z
    CLASS:PUBLIC
    CREATED:20240429T195210Z
    DESCRIPTION:Occupé
    DTSTART;TZID=Europe/Paris:20240428T220000
    DTEND;TZID=Europe/Paris:20240505T220000
    LAST-MODIFIED:20240429T231521Z
    SEQUENCE:2
    SUMMARY:Occupé
    TRANSP:OPAQUE
    END:VEVENT
    BEGIN:VEVENT
    UID:1d680695-bc16-4e35-93f5-5014f80b9764
    DTSTAMP:20240430T001520Z
    CLASS:PUBLIC
    CREATED:20240429T232333Z
    DESCRIPTION:Occupé
    DTSTART;TZID=Europe/Paris:20240429T220000
    DTEND;TZID=Europe/Paris:20240509T220000
    LAST-MODIFIED:20240429T232551Z
    SEQUENCE:3
    SUMMARY:Occupé
    TRANSP:OPAQUE
    END:VEVENT
    BEGIN:VEVENT
    UID:bbb3af71-29d7-409e-ae5f-ec027cd9c861
    DTSTAMP:20240430T001520Z
    CLASS:PUBLIC
    CREATED:20240429T231643Z
    DESCRIPTION:Occupé
    DTSTART;TZID=Europe/Paris:20250124T230000
    DTEND;TZID=Europe/Paris:20250429T220000
    LAST-MODIFIED:20240429T231643Z
    SEQUENCE:4
    SUMMARY:Occupé
    TRANSP:OPAQUE
    END:VEVENT
    END:VCALENDAR

    All my events start and end at 220000 instead of 000000
    2 hours diference beatween Paris & UTC

  • 🇫🇷France lazzyvn paris

    There are 2 hook
    date_ical_import_vcalendar: Allow modules to alter the vcalendar object before we interpret it
    date_ical_import_component: Allow modules to alter the vcalendar component before we parse it into a Feeds-compatible data array
    You can alter data before icalcreator parse.

  • 🇫🇷France mchamps Finistère

    As a hotfix I changed my Site Time Zone to UTC and my events are displaying properly on all calendar, internal & iCal.

    Thanks lazzyvn for the hooks' information.

  • 🇫🇷France mchamps Finistère

    Hi lazzyvn,
    Can you give me more informations about the hooks and how it works to get them to use the right TimeZone ?
    Thanks in advance !

    • 820c86d8 committed on 4.x
      Issue #3423936: Incorrect time exporting into calendar
      
  • 🇫🇷France lazzyvn paris

    @mchamps can you check Dev version, I just add 'Z' in the end of time format

  • Same issue
    Drupal 10.2.7
    Date iCal 4.0.6

    I set a default time zone as Los Angeles
    For Example, I was given a time from June 24, 9:00 am to 3:00 pm date range field

    But I my calender it is show as

    But I need to show the local timing and import same time on the calender.

    Kindly any one help me do this.

    • f7f83c19 committed on 4.x
      Issue #3423936: Incorrect time exporting into calendar
      
  • 🇫🇷France lazzyvn paris

    @dinesh.s did you check dev version?

  • Yes, @lazzyvn that didn't fix my issue.

  • 🇫🇷France lazzyvn paris

    ical it check system time zone not user timezone. I checked with Outlook it works fine

  • 🇫🇷France mchamps Finistère

    What I have setup :
    on my PC local timezone is set to Paris

    /admin/config/regional/settings :
    - Default time zone > Paris
    - Users may set their own time zone > unchecked

    A content with 2 Date fields
    Arrival : 02/07/2024 00:00:00
    Departure : 07/07/2024 00:00:00

    A view, Format: iCal Feed

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//https://-.-.com//NONSGML iCalcreator 2.41.90//
    CALSCALE:GREGORIAN
    METHOD:PUBLISH
    UID:36663133-3131-4732-b030-326537323034
    X-WR-RELCALID:fd2a130b-361c-45b9-9e27-f6aaaf33e6a0
    X-WR-TIMEZONE:Europe/Paris
    X-WR-CALNAME:Calendrier de mon site
    BEGIN:VTIMEZONE
    TZID:Europe/Paris
    TZUNTIL:20261025T010000Z
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:20231029T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RDATE:20241027T030000
    RDATE:20251026T030000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:20240331T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RDATE:20250330T020000
    RDATE:20260329T020000
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    UID:fa3a397f-629c-43c5-8b1b-5cbc7a60e7e8
    DTSTAMP:20240624T233331Z
    CLASS:PUBLIC
    CREATED:20240613T080257Z
    DESCRIPTION:Téléphone : || Arrivée : mar\, 02/07/2024 - 00:00 || Départ : d
    im\, 07/07/2024 - 00:00
    DTSTART;TZID=Europe/Paris:20240701T220000
    DTEND;TZID=Europe/Paris:20240706T220000
    LAST-MODIFIED:20240624T233325Z
    LOCATION;ALTREP="https://-.-.com/fr/taxonomy/term/166"
    :Menez Hom
    SEQUENCE:1
    SUMMARY:Déjà complet
    TRANSP:OPAQUE
    X-ALT-DESC;FMTTYPE=TEXT/HTML:Téléphone : || Arrivée : 07-01T22:00:00Z' class='datetime'>mar\, 02/07/2024 - 00:00 || Dépar
    t : dim\, 07/07/202
    4 - 00:00
    END:VEVENT

    On thunderbird, it displays event
    Start Date Monday, 1 July 2024 22:00
    End Date Saturday, 6 July 2024 22:00

    On airbnb, the days are blocked
    from Monday, 1 July 2024
    to Friday, 5 July 2024,
    the 6th is available

    On my website, I use Full Calendar Display the days
    from Tuesday, 2 July 2024 12:00am
    to Saturday 6 July 2024
    are blocked

    I hope it helps. Thanks for the help !

  • 🇬🇧United Kingdom bluehead

    We are having the same issue in UK. All dates are shifted by -1 hour no matter what settings. Those marked as All Day (00:00)are being displayed a day earlier at 11.00pm

  • 🇫🇷France lazzyvn paris

    That is what i test on my local
    Config timezone

    Field

    Views

    Import outlook

    For me it works exactly time i want

    You can debug in modules/contrib/date_ical/src/DateICal.php
    Line 49 and 66.

            $date = new \DateTime($start, new \DateTimeZone('UTC'));
            $date->setTimezone($dateTimeZone);
            $start = $date->format("Y-m-d\TH:i:s");
    

    It just takes raw value from database in UTC after set timezone by configuration and format data for ical

  • 🇬🇧United Kingdom bluehead

    #20 seems to work as expected
    Thank you @lazzyvn

  • 🇫🇷France mchamps Finistère

    #20 works for me too.
    I had to tick Users may set their own time zone and found out my BIOS was 2 hours late 22:00 instead of 00:00
    It works for Thunderbird, Views Full Calendar, AirBnB on D10.3

    Thanks You @lazzyvn for your time & patience

  • Thank you @lazzyvn for your valuable time

    If I have the date and time it is working as expected.

    But if I have only the date without having any time selected
    it gets the default timezone as 12:00 AM UTC and converts it into the local timezone.
    Scenario: If I select July 08/07/24 - 12/07/24 It gets the default time as 12:00 AM UTC showing in the calendar as 07/07/24 to 11/07/24 at 05:00:00 PM

    I set my time zone as Los Angeles

  • 🇫🇷France lazzyvn paris

    From my understanding, if you only save the date without time, in the system it saves your date and time equal to the time you save, it takes the time of system to save. You can check in the database and see. If I have free time and a customer complains about this problem, I will deepen the date at 00:00 and finish at 23:59. Currently there is no request, so you can wait in the future :).

  • 🇫🇷France mchamps Finistère

    FYI, I tested everything... again... it failed, events were all over the place

    I update date_ical to latest version : 4.0.7
    I fixed my issues straight away.

    Thanks !

  • Status changed to Fixed 5 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇺🇸United States spivey

    What was the final fix for this?

Production build 0.71.5 2024