Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49561

Error in iCalendar export of zero duration events from Moodle

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • MDL-49561_master
    • Hide
      Test 1
      1. Log in as an administrator.
      2. Click on the title of the calendar block.
      3. Create a new event without any duration.
      4. Export the calendar.
      5. The icalendar event should contain dates like the following (where YYYYMMDD is the start day and YYYYMMDD+1 is the day after - code section below)
      6. Export the event into a google calendar and ensure it works as expected.

      DTSTART;VALUE=DATE:YYYYMMDD
      DTEND;VALUE=DATE:YYYYMMDD+1
      

      Test 2
      1. Log in as an administrator.
      2. Click on the title of the calendar block.
      3. Create a new event with a duration.
      4. Export the calendar.
      5. The icalendar event should contain dates like the following (where YYYYMMDDTXXXXX is the start time - see code section below). The value after the T is the time in 24hr format.
      6. Export the event into a google calendar and ensure it works as expected.

      DTSTART:YYYYMMDDTXXXXX
      DTEND:YYYYMMDDTXXXXX
      

      Show
      Test 1 Log in as an administrator. Click on the title of the calendar block. Create a new event without any duration. Export the calendar. The icalendar event should contain dates like the following (where YYYYMMDD is the start day and YYYYMMDD+1 is the day after - code section below) Export the event into a google calendar and ensure it works as expected. DTSTART;VALUE=DATE:YYYYMMDD DTEND;VALUE=DATE:YYYYMMDD+1 Test 2 Log in as an administrator. Click on the title of the calendar block. Create a new event with a duration. Export the calendar. The icalendar event should contain dates like the following (where YYYYMMDDTXXXXX is the start time - see code section below). The value after the T is the time in 24hr format. Export the event into a google calendar and ensure it works as expected. DTSTART:YYYYMMDDTXXXXX DTEND:YYYYMMDDTXXXXX

      When exporting a calendar from Moodle as ical, there is a problem with
      events with zero duration (called "without duration in Moodle)

      Currently this is exported with only a DTSTART, ex.:

      DTSTART:20150312T132500Z

      This causes different behaviour in eg. Google Calendar and Microsoft
      Outlook. Google sets the event to a 1 hour duration, Outlook more
      correcly issues an error.

      According to RFC2445 (see below) zero duration events should exported
      with VALUE=DATE in DTSTART, eg.:

      DTSTART;VALUE=DATE:20150312

      According to RFC2445 DTEND can then be omitted, but a large number of
      ical validators doesn't like that end it is OK to set it. So the above
      should be exported as:

      DTSTART;VALUE=DATE:20150312
      DTEND;VALUE=DATE:20150313

      The attached patch implements this.

      Ref. 4.6.1 in RFC2445:

      "...The "VEVENT" is also the calendar component used to specify an
      anniversary or daily reminder within a calendar. These events have a
      DATE value type for the "DTSTART" property instead of the default
      data type of DATE-TIME. If such a "VEVENT" has a "DTEND" property, it
      MUST be specified as a DATE value also. The anniversary type of
      "VEVENT" can span more than one date (i.e, "DTEND" property value is
      set to a calendar date after the "DTSTART" property value)...."

            markn Mark Nelson
            lsa-its Lars Anderson
            Mark Nelson Mark Nelson
            David Monllaó David Monllaó
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.