Internet-Draft | iCalendar Property Extensions | October 2020 |
Daboo & Yakushev | Expires 4 April 2021 | [Page] |
This document defines how non-Gregorian recurrence rules can be specified in iCalendar data.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 4 April 2021.¶
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The iCalendar [RFC5545] data format is in widespread use to represent calendar data. iCalendar represents dates and times using the Gregorian calendar system only. It does provide a way to use non-Gregorian calendar systems via a "CALSCALE" property, however this has never been formally used. However, there is a need to support at least non-Gregorian recurrence patterns to cover anniversaries, and many local, religious, or civil holidays based on non-Gregorian dates.¶
There are several disadvantages to using the existing "CALSCALE" property in iCalendar for implementing non-Gregorian calendars:¶
This specification solves these issues by allowing the "CALSCALE" to remain set to Gregorian, but re-defining the recurrence rule property "RRULE" to accept new items including one that allows non-Gregorian calendar systems to be used. With this, all the date, time and period values in the iCalendar object would remain specified using the Gregorian calendar system, but repeating patterns in other calendar systems could be defined. It is then up to calendar user agents and servers to map between Gregorian and non-Gregorian calendar systems in order to expand out recurrence instances.¶
This specification does not itself define calendar systems, rather it utilizes the calendar system registry defined by the Unicode Consortium in their CLDR (Common Locale Data Repository) project [UNICODE.CLDR].¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].¶
The notation used in this memo is the ABNF notation of [RFC5234] as used by iCalendar [RFC5545]. Any syntax elements shown below that are not explicitly defined in this specification come from iCalendar [RFC5545], iTIP [RFC5546], and CalDAV [RFC4791].¶
When XML element types in the namespaces "DAV:" and "urn:ietf:params:xml:ns:caldav" are referenced in this document outside of the context of an XML fragment, the string "DAV:" and "CALDAV:" will be prefixed to the element type names respectively.¶
When a Gregorian calendar date value is shown in text, it will use the format "YYYYMMHH", where "YYYY" is the 4-digit year, "MM" the 2-digit month, and "DD" the 2-digit day (this is the same format used in iCalendar [RFC5545]). The Chinese calendar will be used as an example of a non-Gregorian calendar for illustrative purposes. When a Chinese calendar date value is shown in text, it will use the format "{C}YYYYMM[L]DD" - i.e., the same format as Gregorian but with a "{C}" prefix, and an optional "L" character after the month element to indicate a leap month. Similarly, {E} and {H} are used in other examples as prefixes for Ethiopic (Amete Mihret) and Hebrew dates, respectively. Note that the Chinese calendar years shown in the examples are based on the Unicode (ICU) [UNICODE.ICU] library's Chinese calendar epoch. Whilst there are several different Chinese calendar epochs in common use, the choice of one over another does not impact the actual calculation of the Gregorian equivalent dates, provided conversion is always done using the same epoch.¶
In the Gregorian calendar system, each year is composed of a fixed number of months (12), with each month having a fixed number of days (between 30 and 31), except for the second month (February) which contains either 28 days, or 29 days (in a leap year). Weeks are composed of 7 days, with day names Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday. Years can have either 365 or 366 days (the later in a leap year). The number of whole weeks in a year is 52.¶
In iCalendar, the "RECUR" value type defines various fields used to express a recurrence pattern, and those fields are given limits based on those of the Gregorian calendar system. Since other calendar systems can have different limits and other behaviors that need to be accounted for, the maximum values for the elements in the "RECUR" value are not covered by this specification.¶
To generate a set of recurring instances in a non-Gregorian calendar system, the following procedure is used:¶
When generating instances, the following procedure might be used:¶
Consider the following example for an event representing the Chinese New Year:¶
DTSTART;VALUE=DATE:20130210 RRULE:RSCALE=CHINESE;FREQ=YEARLY SUMMARY:Chinese New Year¶
To generate instances, first the "DTSTART" value "20130210" is converted into the Chinese calendar system giving "{C}46500101". Next, the year component is incremented by one to give "{C}46510101", and that is then converted back into Gregorian as "20140131". Additional instances are generated by iteratively increasing the year component in the Chinese date value and converting back to Gregorian.¶
This specification extends the existing "RRULE" iCalendar property value to include a new "RSCALE" element that can be used to indicate the calendar system used for generating the recurrence pattern.¶
When "RSCALE" is present, the other changes to "RRULE" are:¶
The syntax for the "RECUR" value is modified in the following fashion:¶
recur-rule-part /= ("RSCALE" "=" rscale) / ("SKIP" "=" skip) rscale = (iana-token ; A CLDR-registered calendar system ; name. / x-name) ; A non-standard, experimental ; calendar system name. ; Names are case-insensitive, ; but uppercase values are preferred. skip = ("YES" / "BACKWARD" / "FORWARD") ; Optional, with default value "BACKWARD", ; and MUST only be present if "RSCALE" is present. monthnum = 1*2DIGIT ["L"] ; Existing element modified to include a leap ; month indicator suffix.¶
Leap months can occur in different calendar systems. For such calendar systems the following rules are applied for "identifying" months:¶
Care has to be taken when mapping the month identifiers used here with those of any underlying calendar system library being used. In particular, the Hebrew calendar system used by Unicode (ICU) [UNICODE.ICU] uses a month number scheme of 1 through 13, with month 6 being the leap month, and in non-leap years, month 6 is skipped. In iCalendar, this would map to months 1 through 12 with "5L" as the leap month.¶
Consider the following set of iCalendar properties:¶
DTSTART;VALUE=DATE:20130210 RRULE:RSCALE=CHINESE;FREQ=YEARLY SUMMARY:Chinese New Year¶
These define a recurring event for the Chinese New Year, with the first instance the one in Gregorian year 2013.¶
The Chinese date corresponding to the first instance is {C}46500101. The table below shows the initial instance, and the next four, each of which is determined by adding the appropriate amount to the year component of the Chinese date. Also shown is the conversion back to the Gregorian date:¶
Chinese Date | Gregorian Date |
---|---|
{C}46500101 | 20130210 - DTSTART value |
{C}46510101 | 20140131 |
{C}46520101 | 20150219 |
{C}46530101 | 20160208 |
{C}46540101 | 20170128 |
Consider the following set of iCalendar properties:¶
DTSTART;VALUE=DATE:201300906 RRULE:RSCALE=ETHIOPIC;FREQ=YEARLY;BYMONTH=13 SUMMARY:First day of 13th month¶
These define a recurring event for the first day of the 13th month, with the first instance the one in Gregorian year 2013.¶
The Ethiopic date corresponding to the first instance is {E}20051301. The table below shows the initial instance, and the next four, each of which is determined by adding the appropriate amount to the year component of the Ethiopic date. Also shown is the conversion back to the Gregorian date:¶
Ethiopic Date | Gregorian Date |
---|---|
{E}20051301 | 20130906 - DTSTART value |
{E}20061301 | 20140906 |
{E}20071301 | 20150906 |
{E}20081301 | 20160906 |
{E}20091301 | 20170906 |
Note that in this example, the value of the "BYMONTH" component in the "RRULE" matches the Ethiopic month value and not the Gregorian month.¶
Consider the following set of iCalendar properties:¶
DTSTART;VALUE=DATE:20140208 RRULE:RSCALE=HEBREW;FREQ=YEARLY;BYMONTH=5L;BYMONTHDAY=8;SKIP=FORWARD SUMMARY:Anniversary¶
These define a recurring event for the 8th day of the Hebrew month of Adar I (the leap month identified by "5L"), with the first instance the one in Gregorian year 2014.¶
The Hebrew date corresponding to the first instance is {H}577405L08, which is a leap month in year 5774. The table below shows the initial instance, and the next four, each of which is determined by adding the appropriate amount to the year component of the Hebrew date, taking into account that only year 5776 is a leap year. Thus in other years the Hebrew month component is adjusted forward to month 6. Also shown is the conversion back to the Gregorian date:¶
Hebrew Date | Gregorian Date |
---|---|
{H}577405L08 | 20140208 - DTSTART value |
{H}57750608 | 20150227 |
{H}577605L08 | 20160217 |
{H}57770608 | 20170306 |
{H}57780608 | 20180223 |
Consider the following set of iCalendar properties:¶
DTSTART;VALUE=DATE:20120229 RRULE:FREQ=YEARLY SUMMARY:Anniversary¶
These define a recurring event for the 29th February, 2012 in the standard iCalendar calendar scale - Gregorian. The standard iCalendar behavior is that non-existent dates in a recurrence set are ignored. Thus the properties above would only generate instances in leap years (2016, 2020, etc), which is likely not what users expect. The new "RSCALE" option defined by this specification provides the "SKIP" element which can be used to "fill in" the missing instances in an appropriate fashion. The set of iCalendar properties below do that:¶
DTSTART;VALUE=DATE:20120229 RRULE:RSCALE=GREGORIAN;FREQ=YEARLY;SKIP=FORWARD SUMMARY:Anniversary¶
With these properties, the "missing" instances in non-leap year now appear on the 1st March in those years:¶
Instances (with SKIP=FORWARD) | Instances (without RSCALE) |
---|---|
20120229 | 20120229 - DTSTART value |
20130301 | |
20140301 | |
20150301 | |
20160229 | 20160229 |
20170301 |
This specification uses the Unicode Consortium's registry of calendar systems [UNICODE.CLDR] to define valid values for the "RSCALE" element of an "RRULE". Note that the underscore character "_" is never used in CLDR-based calendar system names. New values can be added to this registry following Unicode Consortium rules. It is expected that many implementations of non-Gregorian calendars will use software libraries provided by Unicode (ICU) [UNICODE.ICU], and hence it makes sense to re-use their registry rather than creating a new one. For consistency, when used, the "RSCALE" values SHOULD be uppercased.¶
CLDR supports the use of "alias" values as alternative names for specific calendar systems. These alias values MUST be treated as valid "RSCALE" element values.¶
When using the CLDR data, calendar agents SHOULD take into account the "deprecated" value and use the alternative "preferred" calendar system. In particular, the "islamicc" calendar system is considered deprecated in favor of the "islamic-civil" calendar system.¶
iTIP [RFC5546] defines how iCalendar data can be sent between calendar user agents to schedule calendar components between calendar users. It is often not possible to know the capabilities of a calendar user agent to which an iTIP message is being sent, but iTIP defines fallback behavior in such cases.¶
For calendar user agents that do not support the "RSCALE" element, the following can occur when iTIP messages containing an "RSCALE" element are received:¶
For calendar user agents that support the "RSCALE" element but do not support the calendar system specified by the "RSCALE" element value, the following can occur:¶
The CalDAV [RFC4791] calendar access protocol allows clients and server to exchange iCalendar data. In addition, CalDAV clients are able to query calendar data stored on the server, including time-based queries. Since an "RSCALE" element value determines the time ranges for recurring instances in a calendar component, CalDAV servers need to support it to interoperate with clients also using the "RSCALE" element.¶
A CalDAV server advertises a CALDAV:supported-rscale-set WebDAV property on calendar home or calendar collections if it supports use of "RSCALE" element as described in this specification. The server can advertise a specific set of supported calendar systems by including one or more CALDAV:supported-rscale XML elements within the CALDAV:supported-rscale-set XML element. If no CALDAV:supported-rscale XML elements are included in the WebDAV property, then clients can try any calendar system value, but need to be prepared for a failure when attempting to store the calendar data.¶
Clients MUST NOT attempt to store iCalendar data containing "RSCALE" elements if the CALDAV:supported-rscale-set WebDAV property is not advertised by the server.¶
The server SHOULD return an HTTP 403 response with a DAV:error element containing a CALDAV:supported-rscale XML element, if a client attempts to store iCalendar data with an "RSCALE" element value not supported by the server.¶
It is possible for a "RSCALE" value to be present in calendar data on the server being accessed by a client that does not support an "RSCALE" element or its specified value. It is expected that existing clients, unaware of "RSCALE", will fail gracefully by ignoring the calendar component, whilst still processing other calendar data on the server.¶
<!ELEMENT supported-rscale-set (supported-rscale*) > <!ELEMENT supported-rscale (#PCDATA)> <!-- PCDATA value: string - case-insensitive but uppercase preferred -->¶
<C:supported-rscale-set xmlns:C="urn:ietf:params:xml:ns:caldav"> <C:supported-rscale>GREGORIAN</C:supported-rscale> <C:supported-rscale>CHINESE</C:supported-rscale> <C:supported-rscale>ISLAMIC-CIVIL</C:supported-rscale> <C:supported-rscale>HEBREW</C:supported-rscale> <C:supported-rscale>ETHIOPIC</C:supported-rscale> </C:supported-rscale-set>¶
This specification does not introduce any addition security concerns beyond those described in [RFC5545], [RFC5546], and [RFC4791].¶
This specification does not define any new IANA registries or values.¶
Thanks to the following for feedback: Mark Davis, Mike Douglass, Peter Edberg, Marten Gajda, Arnaud Quillaud, Dave Thewlis, and Umaoka Yoshito. This specification came about via discussions at the Calendaring and Scheduling Consortium.¶
Changes in -04:¶
Changes in -03:¶
Changes in -02:¶
Changes in -01:¶