Internet-Draft | iCalendar Fractional Time | July 2021 |
Jenkins, et al. | Expires 8 January 2022 | [Page] |
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 8 January 2022.¶
Copyright (c) 2021 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
There has been an expressed need for the ability to use fractional seconds in iCalendar. With the advent of JSCalendar there is a way to do so in that representation. This specification provides a - partially backwards compatible - way to represent such times in iCalendar.¶
It is probable that applications needing fractional seconds require recurrence rules that use sub-second intervals.¶
This specification also shows how values should be mapped to and from JSCalendar.¶
FRACTIONAL¶
This parameter is used to contain a value with fractional seconds for time values and durations.¶
This parameter MAY be specified on properties of type DATE-TIME or DURATION. It MUST be a valid iCalendar DATE-TIME or DURATION value with the addition of fractional seconds. The value MUST NOT be negative for durations but MAY be negative for alarm triggers.¶
Applications receiving a property with a FRACTIONAL parameter MUST ensure its value is consistent with the value of the property. The property value must match:¶
If the values do not match the the application MUST assume that the property value has been updated by an application that is unaware of the FRACTIONAL parameter. The parameter should be ignored in this case.¶
This parameter is defined by the following notation:¶
fractional-param = DATE-TIME or DURATION¶
DTSTART;FRACTIONAL=20190605T133015.03:20190605T133015¶
If the property has a FRACTIONAL parameter first check that it is a valid value using the criteria specified in Section 2.1. If valid, use that value for the iCalendar property.¶
If the property has no FRACTIONAL parameter or the value of that parameter is invalid then use the normal property value.¶
For example:¶
... ESTIMATED-DURATION;FRACTIONAL="PT17H15M23.5S:PT18H ... The value here is "PT18H" because the FRACTIONAL parameter is not valid. ... ESTIMATED-DURATION:PT18H ... The value here is "PT18H" because there is no FRACTIONAL parameter. ... ESTIMATED-DURATION;FRACTIONAL="PT17H15M23.5S:PT17H15M24S ... The value here is "PT17H15M23.5S" because the FRACTIONAL parameter is valid.¶
When mapping properties possibly containing time, use the iCalendar property value obtained as specified in Section 3.¶
For example:¶
... ESTIMATED-DURATION;FRACTIONAL="PT17H15M23.5S:PT18H ... maps to ... "estimatedDuration": "PT18H" ... because the FRACTIONAL parameter is not valid. ... ESTIMATED-DURATION:PT18H ... maps to ... "estimatedDuration": "PT18H" ... and ... ESTIMATED-DURATION;FRACTIONAL="PT17H15M23.5S:PT17H15M24S ... maps to ... "estimatedDuration": "PT17H15M23.5S" ... because the FRACTIONAL parameter is valid.¶
If the JSCalendar property value has fractional seconds then the [RFC5545] value is set to the JSCalendar property value rounded up to the next non-fractional value and a FRACTIONAL parameter is added with the full unrounded value.¶
For example:¶
... "duration": "PT0.5S" ... maps to ... DURATION;FRACTIONAL="PT0.5S":PT1S ... and ... "duration": "PT1H" ... maps to ... DURATION:PT1H ...¶