RFC 7953

Calendar Availability

๐Ÿ“… published August 2016, from ietf

Calendar Availability ๐Ÿฆ‹

okay bestie, RFC 7953 is literally about giving your calendar a glow-up โœจ It's Request for Comments 7953, titled "Calendar Availability." It's an IETF Standards Track document from August 2016, so it's an official spec and not just someone's opinion ๐Ÿ’… It was written by C. Daboo from Apple and M. Douglass from Spherical Cow Group. Its ISSN is 2070-1721. It also updates RFC 4791, RFC 5545 and RFC 6638, which means it adds new stuff on top of those three specs ๐ŸŽ€

Abstract โœจ

okay so this doc defines a brand-new iCalendar component (that's RFC 5545 territory ๐ŸŒˆ) for publishing the time periods when someone is available or unavailable. It's giving "my schedule, but make it a rule." You can use it in normal iCalendar free-busy lookups, including the free-busy requests in the iCalendar Transport-independent Interoperability Protocol (iTIP; RFC 5546), to make repeating blocks of free or busy time with exceptions wherever you need them ๐Ÿฆ‹

It also extends the Calendaring Extensions to WebDAV (CalDAV) calendar access protocol (RFC 4791) and its scheduling protocol (RFC 6638). This shows how the new component fits into checking free-busy time ๐Ÿ’œ

Status of This Memo ๐ŸŒธ

this one is an Internet Standards Track document ๐Ÿ’–

It's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 7841 ๐ŸŽ€

For the current status, any errata, and how to send feedback, go to http://www.rfc-editor.org/info/rfc7953 ๐Ÿ”ฅ

Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved, obviously ๐Ÿ’…

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they were in effect on the date of publication. Please actually read these, because they explain your rights and restrictions for this document ๐Ÿ™ˆ Any Code Components pulled out of this document must include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes ๐Ÿซถ

Table of Contents ๐Ÿงš

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  iCalendar Extensions  . . . . . . . . . . . . . . . . . . . .   4
     3.1.  VAVAILABILITY Component . . . . . . . . . . . . . . . . .   4
     3.2.  Busy Time Type  . . . . . . . . . . . . . . . . . . . . .  10
   4.  Combining VAVAILABILITY Components  . . . . . . . . . . . . .  10
   5.  Calculating Free-Busy Time  . . . . . . . . . . . . . . . . .  12
     5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .  13
   6.  Use with iTIP . . . . . . . . . . . . . . . . . . . . . . . .  15
   7.  CalDAV Extensions . . . . . . . . . . . . . . . . . . . . . .  15
     7.1.  CalDAV Requirements Overview  . . . . . . . . . . . . . .  15
     7.2.  New Features in CalDAV  . . . . . . . . . . . . . . . . .  16
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  19
   9.  Privacy Considerations  . . . . . . . . . . . . . . . . . . .  19
   10. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  20
     10.1.  Component Registrations  . . . . . . . . . . . . . . . .  20
     10.2.  Property Registrations . . . . . . . . . . . . . . . . .  20
   11. Normative References  . . . . . . . . . . . . . . . . . . . .  20
   Appendix A.  Example Calendar #1  . . . . . . . . . . . . . . . .  22
   Appendix B.  Example Calendar #2  . . . . . . . . . . . . . . . .  23
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  24
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  24

1. Introduction ๐ŸŽ€

calendar users often have regular stretches of time when they're either open for booking or always unavailable ๐Ÿ“ For example, an office worker usually only wants to look free to their coworkers during normal 'office hours' (e.g., Monday through Friday, 9 am through 5 pm) ๐Ÿ’ผ Or a university professor might only be available to students during a set window, like Thursday afternoons, 2 pm through 5 pm, but only during term time ๐Ÿ“š Ideally, users should be able to set these periods straight from their calendar user agent, and have them count automatically in the normal free-busy lookup for that user โœจ It also ought to be possible to show different available periods depending on who's asking ๐Ÿ‘‘

iCalendar [RFC5545] has a "VFREEBUSY" component that can represent fixed busy time periods. But it has no way to describe a repeating period of available or unavailable time ๐Ÿ˜ญ Since repeating patterns are super common, "VFREEBUSY" components just aren't enough to solve this ๐Ÿ’€

So this spec defines a new type of iCalendar component for publishing user availability ๐Ÿฆ‹

CalDAV [RFC4791] lets calendar users access and manage calendar data, and exchange that data through scheduling operations ๐ŸŒธ Part of that is the CalDAV calendar-access [RFC4791] feature, which provides a CALDAV:free-busy-query REPORT that returns free-busy information for a calendar collection or a hierarchy of calendar collections ๐Ÿ’… The CalDAV calendar-auto-schedule [RFC6638] feature can also work out free-busy information for a calendar user ๐Ÿซถ Both of these look through user calendars for events that 'block time', and the blocked-out periods come back inside a "VFREEBUSY" component ๐Ÿ”ฅ

This spec extends the CalDAV calendar-access and CalDAV calendar-auto-schedule features so the new iCalendar availability components can be stored and manipulated. It also lets free-busy lookups use info from any of those components, if they're present ๐ŸŒˆ

2. Conventions Used in This Document ๐Ÿ’–

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] ๐ŸŽ€

When XML element types in the namespaces "DAV:" and "urn:ietf:params:xml:ns:caldav" are mentioned outside of an XML fragment, the strings "DAV:" and "CALDAV:" get prefixed to the element type names, respectively ๐Ÿงš

3. iCalendar Extensions ๐ŸŒธ

this spec adds a new "VAVAILABILITY" calendar component to iCalendar ๐Ÿ’œ The "VAVAILABILITY" component is basically a container for new "AVAILABLE" subcomponents ๐Ÿฆ‹

The whole point of "VAVAILABILITY" is to group available time info over a specific range of time ๐Ÿ“ Inside that range, certain time spans get marked as available using a set of "AVAILABLE" calendar subcomponents โœจ Together, they can describe available time that repeats over set periods and can change over time ๐Ÿ‘‘

Here's the vibe, drawn out:

                         Time Range
   <=========================================================>

      +-------------------------------------------------+
      |              VAVAILABILITY                      |
      +-------------------------------------------------+
         +------------+       +------------+
         | AVAILABLE  |       | AVAILABLE  |
         +------------+       +------------+

      <->              <----->              <-----------> Busy Time

the overall time range is at the top ๐ŸŒˆ A "VAVAILABILITY" component covers part of that range. Any time the "VAVAILABILITY" component covers is treated as busy, except for the ranges covered by the "AVAILABLE" components inside it ๐Ÿ’…

3.1. VAVAILABILITY Component

Component Name: VAVAILABILITY ๐Ÿ’œ

Purpose: Groups together the properties and subcomponents that describe the availability of a calendar user ๐ŸŽ€

Format Definition: okay so a VAVAILABILITY calendar component is written like this ๐Ÿ‘‡

availabilityc  = "BEGIN" ":" "VAVAILABILITY" CRLF
                availabilityprop *availablec
                "END" ":" "VAVAILABILITY" CRLF

availabilityprop  = *(
                 ;
                 ; the following are REQUIRED
                 ; but MUST NOT occur more than once
                 ;
                 dtstamp / uid
                 ;
                 ; the following are OPTIONAL
                 ; but MUST NOT occur more than once
                 ;
                 busytype / class / created / description /
                 dtstart / last-mod / location / organizer /
                 priority /seq / summary / url /
                 ;
                 ; Either 'dtend' or 'duration' MAY appear
                 ; in an 'availableprop', but 'dtend' and
                 ; 'duration' MUST NOT occur in the same
                 ; 'availabilityprop'.
                 ; 'duration' MUST NOT be present if
                 ; 'dtstart' is not present
                 ;
                 dtend / duration /
                 ;
                 ; the following are OPTIONAL
                 ; and MAY occur more than once
                 ;
                 categories / comment / contact /
                 x-prop / iana-prop
                 ;
                 )

availablec  = "BEGIN" ":" "AVAILABLE" CRLF
              availableprop
              "END" ":" "AVAILABLE" CRLF

availableprop  = *(
               ;
               ; the following are REQUIRED
               ; but MUST NOT occur more than once
               ;
               dtstamp / dtstart / uid /
               ;
               ; Either 'dtend' or 'duration' MAY appear in
               ; an 'availableprop', but 'dtend' and
               ; 'duration' MUST NOT occur in the same
               ; 'availableprop'.
               ;
               dtend / duration /
               ;
               ; the following are OPTIONAL
               ; but MUST NOT occur more than once
               ;
               created / description / last-mod /
               location / recurid / rrule / summary /
               ;
               ; the following are OPTIONAL
               ; and MAY occur more than once
               ;
               categories / comment / contact / exdate /
               rdate / x-prop / iana-prop
               ;
               )

Description: A VAVAILABILITY component is basically a window of time that says "here's when I'm available" โœจ It can have a start time and an end time, or a start time and a duration. No DTSTART? Then the start is unbounded ๐ŸŒˆ No DTEND or DURATION? Then the end is unbounded too. Inside that window, everything defaults to a free-busy type of BUSY-UNAVAILABLE (see Section 3.2), except for the times covered by AVAILABLE subcomponents. Those are the free-time slots ๐Ÿฆ‹

AVAILABLE subcomponents MAY include recurrence properties so they can repeat, and those repeats can be overridden with normal iCalendar recurrence behaviour, aka by using the RECURRENCE-ID property ๐Ÿ”

If they're specified, the DTSTART and DTEND properties in VAVAILABILITY components and AVAILABLE subcomponents MUST be DATE-TIME values, written either as a date with UTC time or as a date with local time plus a time zone reference ๐Ÿ•ฐ๏ธ

The iCalendar object that holds the VAVAILABILITY component MUST contain the right VTIMEZONE components for every unique TZID parameter value used in any DATE-TIME property in all components, unless [RFC7809] is in effect ๐ŸŒ

When it's used to publish available time, the ORGANIZER property tells you which calendar user that published available time belongs to ๐Ÿ’

If the PRIORITY property is specified in VAVAILABILITY components, it decides how that component gets combined with other VAVAILABILITY components. See Section 4 for the full tea โ˜•

Other calendar properties MAY be specified in VAVAILABILITY or AVAILABLE components. They count as attributes of that marked block of time, and how you use them is up to the application ๐Ÿ’… For example, LOCATION could show that someone is in one place for part of the week and somewhere else the rest of the week (but check Section 9 before you add extra data like this, bestie ๐Ÿ™ˆ).

Example: Here's a VAVAILABILITY component showing a user who's always available Monday to Friday, 9:00 am to 5:00 pm, in the America/Montreal time zone ๐Ÿ“

BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:0428C7D2-688E-4D2E-AC52-CD112E2469DF
DTSTAMP:20111005T133225Z
BEGIN:AVAILABLE
UID:34EDA59B-6BB1-4E94-A66C-64999089C0AF
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
END:AVAILABLE
END:VAVAILABILITY

Now this one is giving main character energy ๐Ÿ‘‘ It shows a user available Monday through Thursday, 9:00 am to 5:00 pm, at the main office, and Friday, 9:00 am to 12:00 pm, at the branch office, all in America/Montreal, between October 2nd and December 2nd 2011 ๐Ÿขโœจ

BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:84D0F948-7FC6-4C1D-BBF3-BA9827B424B5
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
DTEND;TZID=America/Montreal:20111202T000000
BEGIN:AVAILABLE
UID:7B33093A-7F98-4EED-B381-A5652530F04D
SUMMARY:Monday to Thursday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH
LOCATION:Main Office
END:AVAILABLE
BEGIN:AVAILABLE
UID:DF39DC9E-D8C3-492F-9101-0434E8FC1896
SUMMARY:Friday from 9:00 to 12:00
DTSTART;TZID=America/Montreal:20111006T090000
DTEND;TZID=America/Montreal:20111006T120000
RRULE:FREQ=WEEKLY
LOCATION:Branch Office
END:AVAILABLE
END:VAVAILABILITY

Next up is a traveling worker ๐Ÿงณโœˆ๏ธ Same deal, Monday to Friday, 9:00 am to 5:00 pm each day. But for three weeks they're in Montreal, then one week in Denver, then back to Montreal. Each of those stretches gets its own VAVAILABILITY component. The last one has no DTEND, so it keeps going "forever" ๐Ÿฅน This example shows one way to represent "blocks" of available time. Section 4 has another approach that uses priorities ๐Ÿงš

BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:BE082249-7BDD-4FE0-BDBA-DE6598C32FC9
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
DTEND;TZID=America/Montreal:20111023T030000
BEGIN:AVAILABLE
UID:54602321-CEDB-4620-9099-757583263981
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Montreal
END:AVAILABLE
END:VAVAILABILITY
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:A1FF55E3-555C-433A-8548-BF4864B5621E
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Denver:20111023T000000
DTEND;TZID=America/Denver:20111030T000000
BEGIN:AVAILABLE
UID:57DD4AAF-3835-46B5-8A39-B3B253157F01
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Denver:20111023T090000
DTEND;TZID=America/Denver:20111023T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Denver
END:AVAILABLE
END:VAVAILABILITY
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:1852F9E1-E0AA-4572-B4C4-ED1680A4DA40
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111030T030000
BEGIN:AVAILABLE
UID:D27C421F-16C2-4ECB-8352-C45CA352C72A
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111030T090000
DTEND;TZID=America/Montreal:20111030T170000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Montreal
END:AVAILABLE
END:VAVAILABILITY

3.2. Busy Time Type

Property Name: BUSYTYPE ๐Ÿซถ

Purpose: This property sets the default busy time type ๐Ÿ’–

Value Type: TEXT ๐Ÿ“

Property Parameters: IANA and nonstandard property parameters can be specified on this property ๐Ÿงฉ

Conformance: This property can be specified within VAVAILABILITY calendar components ๐ŸŽ€

Format Definition: the notation for this property looks like this ๐Ÿ‘‡

busytype      = "BUSYTYPE" busytypeparam ":" busytypevalue CRLF

busytypeparam = *(";" other-param)

busytypevalue = "BUSY" / "BUSY-UNAVAILABLE" /
                "BUSY-TENTATIVE" / iana-token / x-name
               ; Default is "BUSY-UNAVAILABLE".

Description: BUSYTYPE is how you set the default busy time type โœจ The values match the ones used by the FBTYPE parameter on a FREEBUSY property, with one plot twist: the FREE value is not used in this property ๐Ÿ™…โ€โ™€๏ธ If it's not specified on a component that allows this property, the default is BUSY-UNAVAILABLE ๐Ÿ’€

Example: here's what it looks like ๐ŸŒธ

BUSYTYPE:BUSY

4. Combining VAVAILABILITY Components โœจ

okay so the VAVAILABILITY component lets a calendar user describe their availability over long stretches of time using recurrence patterns ๐Ÿ—“๏ธ and honestly that availability is usually pretty steady from year to year ๐Ÿ’…

BUT life is messy ๐Ÿ™ˆ people take vacations or spend a few weeks at a different office, so for that stretch they need to redefine their availability. Instead of editing the existing one, the PRIORITY property lets a new VAVAILABILITY component override others with a lower ordinal priority ๐Ÿ”ฅ Quick heads-up: iCalendar [RFC5545] defines PRIORITY so that 0 is undefined, 1 is the highest priority, and 9 is the lowest ๐Ÿ’œ

When you're combining VAVAILABILITY components, a missing PRIORITY property or a value of 0 means the lowest level of priority ๐Ÿซถ When two or more of them overlap and have the same PRIORITY value, the busy time type that wins is decided in this order: BUSY > BUSY-UNAVAILABLE > BUSY-TENTATIVE. So if one component has a BUSYTYPE of BUSY and another has a BUSYTYPE of BUSY-UNAVAILABLE, the effective busy time type over the overlapping range is BUSY ๐Ÿ‘‘ It's up to whoever creates these components to make sure the combo gives a consistent, expected result, so please be careful bestie ๐Ÿฅน

To work out the available time, sort the intersecting VAVAILABILITY components by priority. The order from lowest to highest PRIORITY values is 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 โœจ

Then step through that list. For each component, the time range it covers gets set to busy, and then the parts of it defined by its AVAILABLE components get set to free ๐Ÿฆ‹

Also, if any VAVAILABILITY component completely covers the date range you care about, any lower priority ones can be ignored ๐Ÿ™ˆ

Usually a person's "default" availability (think business hours, Monday through Friday, 9:00 am to 5:00 pm) uses the lowest priority, which is zero ๐Ÿ“ Any overrides on top of that use higher priorities as needed ๐Ÿ’– Now, to avoid constantly readjusting PRIORITY values every time you need to slide an override in between two existing ones, priority values SHOULD be "spaced out" across the whole range ๐ŸŒˆ The table below shows what I mean. The first row is the priority range from low to high, the second row is the matching PRIORITY property value, and the third row shows which VAVAILABILITY component holds that priority. The "default" availability gets priority zero (that's {a} in the table) ๐Ÿงš Then the first override is made with priority 5 ({b}), a later one can slot in between them using priority 7 ({c}), and another one that takes precedence over everything gets priority 3 ({d}) ๐Ÿ‘‘ As you can see, there are still open "slots" for more VAVAILABILITY components with other priorities whenever you need them โœจ

        +-----+----+----+-----+----+-----+----+-----+----+------+
        | Low |    |    |     |    |     |    |     |    | High |
        +-----+----+----+-----+----+-----+----+-----+----+------+
        |  0  | 9  | 8  |  7  | 6  |  5  | 4  |  3  | 2  |  1   |
        +-----+----+----+-----+----+-----+----+-----+----+------+
        | {a} |    |    | {c} |    | {b} |    | {d} |    |      |
        +-----+----+----+-----+----+-----+----+-----+----+------+

5. Calculating Free-Busy Time ๐Ÿซง

This section is all about how free-busy time info for a calendar user gets calculated when VAVAILABILITY components are involved ๐Ÿ’…

An iCalendar VFREEBUSY component carries "rolled-up" free-busy time info for a calendar user ๐Ÿ’Œ You can get one as the result of an iTIP [RFC5546] free-busy request, or some other way, like a CalDAV calendar-access CALDAV:free-busy-query REPORT ๐Ÿซถ

When one or more VAVAILABILITY components show up and intersect the time range of the free-busy request, you calculate the available time first, as outlined in Section 4 ๐Ÿง  Once that's done, regular VEVENT and VFREEBUSY components can be "overlaid" in the usual way to block out time ๐ŸŒธ

Here's an example procedure for this:

  1. Start by marking the entire period of the free-busy request as free ๐Ÿฆ‹
  2. For each VAVAILABILITY component, ordered by PRIORITY (lowest to highest):
    • A. Check whether the VAVAILABILITY intersects the time range of the free-busy request. If it doesn't, ignore it ๐Ÿ™ˆ
    • B. Check whether the VAVAILABILITY is completely overridden by a higher priority component. If it is, ignore it ๐Ÿ’€
    • C. For the time period the VAVAILABILITY covers, mark time in the free-busy result set as busy, using the busy time type from the BUSYTYPE property in that VAVAILABILITY component ๐Ÿ”ฅ
    • D. Add the VAVAILABILITY component to a list for further processing in step 3, as long as it wasn't ignored ๐Ÿ“
  3. For each VAVAILABILITY component in the list from step 2, in order from first to last:
    • A. For each AVAILABLE component in that VAVAILABILITY component:
      • i. Expand all the recurring instances, taking overridden instances into account. Ignore instances (or parts of instances) that fall outside the free-busy request time range or the time period given by the VAVAILABILITY component ๐Ÿ—“๏ธ
      • ii. For each instance, mark the matching time in the free-busy result set as free โœจ
  4. For each VEVENT or VFREEBUSY component, apply normal free-busy processing within the free-busy request time range ๐Ÿ’–

5.1. Examples ๐ŸŽ€

In the examples below, a table represents the time slots for the period of a free-busy request ๐Ÿ“Š Each time slot is two hours long. The column header shows the hours from midnight local time ๐Ÿ•› Each row under the headers is one step in working out the free-busy result set, following the procedure above ๐Ÿงฉ

Every cell under the column header holds a single character for the free-busy type of that time period at the end of the step shown in that row. The characters are:

  • F means "FREE" time in that slot ๐Ÿฆ‹
  • B means "BUSY" time in that slot ๐Ÿ”ด
  • U means "BUSY-UNAVAILABLE" time in that slot ๐Ÿ’œ
  • T means "BUSY-TENTATIVE" time in that slot ๐ŸŒท
  • I means data to be ignored in that slot (as per step 2.B above) ๐Ÿ™ˆ

5.1.1. Simple Example ๐ŸŒŸ

Appendix A shows the user's calendar. It has one VAVAILABILITY component giving available time within the requested time range of 8:00 am to 6:00 pm, plus one VEVENT component for a two hour meeting starting at 12:00 pm ๐Ÿ“…

A free-busy request for Monday, 6th November 2011, midnight to midnight in the America/Montreal time zone gets calculated like this, using the steps above ๐Ÿงฎ

+------+----+----+----+----+----+----+----+----+----+----+----+----+
| Step | 0  | 2  | 4  | 6  | 8  | 10 | 12 | 14 | 16 | 18 | 20 | 22 |
+------+----+----+----+----+----+----+----+----+----+----+----+----+
| 1.   | F  | F  | F  | F  | F  | F  | F  | F  | F  | F  | F  | F  |
| 2.   | U  | U  | U  | U  | U  | U  | U  | U  | U  | U  | U  | U  |
| 3.   | U  | U  | U  | U  | F  | F  | F  | F  | F  | U  | U  | U  |
| 4.   | U  | U  | U  | U  | F  | F  | B  | F  | F  | U  | U  | U  |
+------+----+----+----+----+----+----+----+----+----+----+----+----+

5.1.2. Further Example ๐Ÿฆ‹

Appendix B shows another way to represent the availability of the traveling worker from before ๐Ÿงณ Their base availability is Monday through Friday, 8:00 am to 6:00 pm each day, and it's set up as a VAVAILABILITY with the default PRIORITY (there's no DTEND property, so this availability is unbounded) โ™พ๏ธ For the week the calendar user is working in Denver (October 23rd through October 30th), their availability is a VAVAILABILITY component with priority 1, which overrides the base availability ๐Ÿ’… There's also a two hour meeting starting at 12:00 pm (in the America/Denver time zone) ๐Ÿฐ

A free-busy request for Monday, 24th October 2011, midnight to midnight in the America/Montreal time zone gets calculated like this, using the steps above. Heads up: there's a two hour offset in the in the available time compared to the previous example ๐Ÿ•‘ That's because of the two hour difference between the time zone of the free-busy request and the time zone of the user's availability and meeting ๐ŸŒ "2.P0" shows the base availability, and "2.P1" shows the higher priority availability ๐Ÿ’œ "3.P1" only shows the higher priority availability contributing to the overall free-busy, since the default availability is ignored (as per step 2.B described above) ๐Ÿ™ˆ

+------+----+----+----+----+----+----+----+----+----+----+----+----+
| Step | 0  | 2  | 4  | 6  | 8  | 10 | 12 | 14 | 16 | 18 | 20 | 22 |
+------+----+----+----+----+----+----+----+----+----+----+----+----+
| 1.   | F  | F  | F  | F  | F  | F  | F  | F  | F  | F  | F  | F  |
| 2.P0 | I  | I  | I  | I  | I  | I  | I  | I  | I  | I  | I  | I  |
| 2.P1 | U  | U  | U  | U  | U  | U  | U  | U  | U  | U  | U  | U  |
| 3.P1 | U  | U  | U  | U  | U  | F  | F  | F  | F  | F  | U  | U  |
| 4.   | U  | U  | U  | U  | U  | F  | F  | B  | F  | F  | U  | U  |
+------+----+----+----+----+----+----+----+----+----+----+----+----+

6. Use with iTIP ๐Ÿ“จ

This spec doesn't define how VAVAILABILITY components get used in scheduling messages sent over the iTIP [RFC5546] protocol ๐Ÿ™ƒ The expectation is that future specs will cover how iTIP scheduling can make use of VAVAILABILITY components ๐Ÿ”ฎ

7. CalDAV Extensions ๐ŸŽ€

7.1. CalDAV Requirements Overview ๐Ÿ“‹โœจ

okay so this is the checklist for what a CalDAV server has to do once it's handling VAVAILABILITY components in stored calendar data ๐Ÿ’… a server:

  • MUST advertise support for VAVAILABILITY components in CALDAV:supported-calendar-component-set properties on calendars that allow storing of such components ๐ŸŽ€
  • MUST support CALDAV:free-busy-query REPORTs that aggregate the info in any VAVAILABILITY components in the calendar collections the request targets ๐Ÿ”ฅ
  • MUST support VAVAILABILITY components stored in a CALDAV:calendar-availability Web Distributed Authoring and Versioning (WebDAV) property on a CalDAV scheduling Inbox collection, if the CalDAV calendar-auto-schedule feature is supported ๐Ÿฆ‹
  • MUST support iTIP [RFC5546] free-busy requests that aggregate the info in any VAVAILABILITY components in calendar collections that contribute to free-busy, or in any VAVAILABILITY components stored in the CALDAV:calendar-availability property on the CalDAV scheduling Inbox collection of the calendar user the iTIP free-busy request targets, if the CalDAV calendar-auto-schedule feature is available ๐ŸŒธ

Processing of VAVAILABILITY components MUST conform to all the requirements CalDAV imposes on calendar object resources (see Section 4.1 of [RFC4791]). it's giving strict-but-fair energy ๐Ÿซถ

7.2. New Features in CalDAV ๐ŸŒˆ

7.2.1. Calendar Availability Support

A server supporting the features described in this document MUST include calendar-availability as a field in the DAV response header from an OPTIONS request. a value of calendar-availability in the DAV response header tells clients that the server supports all the requirements in this document, so clients know they're good to go โœจ

7.2.1.1. Example: Using OPTIONS for the Discovery of Calendar Availability Support

Here's the vibe check in action ๐Ÿ”

>> Request <<

OPTIONS /home/bernard/calendars/ HTTP/1.1
Host: cal.example.com

>> Response <<

HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
Allow: PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL
DAV: 1, 2, 3, access-control, calendar-access,
 calendar-availability
Date: Fri, 11 Nov 2005 09:32:12 GMT
Content-Length: 0

In this example, the OPTIONS method returns calendar-availability in the DAV response header, which means the collection /home/bernard/calendars/ supports the new features defined in this specification. main character discovery moment ๐Ÿ’–

7.2.2. CalDAV Time Range Queries

Section 9.9 of [RFC4791] explains how to specify time ranges to limit the set of calendar components the server returns. this spec extends [RFC4791] to cover how time range filtering works on VAVAILABILITY components ๐Ÿงš

A VAVAILABILITY component is said to overlap a given time range if the condition for the matching component state in the table below is satisfied. the conditions depend on whether DTSTART, DTEND, and DURATION are present in the VAVAILABILITY component. ngl this table is the whole plot ๐Ÿ“Š also, as specified above, the DTEND value MUST be a DATE-TIME value equal to or after the DTSTART value, if specified ๐Ÿ’…

+------------------------------------------------------------+
| VAVAILABILITY has the DTSTART property?                    |
|   +--------------------------------------------------------+
|   | VAVAILABILITY has the DTEND property?                  |
|   |   +----------------------------------------------------+
|   |   | VAVAILABILITY has the DURATION property?           |
|   |   |   +------------------------------------------------+
|   |   |   | Condition to evaluate                          |
+---+---+---+------------------------------------------------+
| Y | Y | N | (start < DTEND  AND  end > DTSTART)            |
+---+---+---+------------------------------------------------+
| Y | N | Y | (start < DTSTART+DURATION  AND  end > DTSTART) |
+---+---+---+------------------------------------------------+
| Y | N | N | (end > DTSTART)                                |
+---+---+---+------------------------------------------------+
| N | Y | N | (start < DTEND)                                |
+---+---+---+------------------------------------------------+
| N | N | * | TRUE                                           |
+---+---+---+------------------------------------------------+

7.2.3. CALDAV:free-busy-query REPORT

A CALDAV:free-busy-query REPORT can run on a calendar collection that holds iCalendar VAVAILABILITY components. when it does, the server MUST aggregate the info in any VAVAILABILITY components when generating the free-busy response, as described in Section 5 ๐Ÿ”ฅ

7.2.4. CALDAV:calendar-availability Property

Name: calendar-availability

Namespace: urn:ietf:params:xml:ns:caldav

Purpose: defines a VAVAILABILITY component that gets used when calculating free-busy time for an iTIP free-busy request aimed at the calendar user who owns the Inbox ๐Ÿ“ฌ

Conformance: this property MAY be protected and SHOULD NOT be returned by a PROPFIND DAV:allprop request. support for this property is REQUIRED. the value of this property MUST be a valid iCalendar object containing only one VAVAILABILITY component, plus optionally VTIMEZONE components. other iCalendar components MUST NOT be present. VTIMEZONE components SHOULD NOT be present if [RFC7809] is in effect. for more complex availability scenarios, clients can store multiple VAVAILABILITY components in the calendar user's calendar collections ๐ŸŒธ

Description: this property lets a user specify their availability by putting a VAVAILABILITY component in its value. if it's present, the server MUST use this VAVAILABILITY component when determining free-busy information as part of an iTIP free-busy request the server is handling ๐Ÿ’œ

Definition:

<!ELEMENT calendar-availability (#PCDATA) >
; Data value MUST be an iCalendar object containing
; "VAVAILABILITY" or "VTIMEZONE" components.

Example:

<C:calendar-availability xmlns:D="DAV:"
xmlns:C="urn:ietf:params:xml:ns:caldav"
>BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//example.com//iCalendar 2.0//EN
VERSION:2.0
BEGIN:VAVAILABILITY
UID:9BADC1F6-0FC4-44BF-AC3D-993BEC8C962A
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
BEGIN:AVAILABLE
UID:6C9F69C3-BDA8-424E-B2CB-7012E796DDF7
SUMMARY:Monday to Friday from 9:00 to 18:00
DTSTART;TZID=America/Montreal:20111002T090000
DTEND;TZID=America/Montreal:20111002T180000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
END:AVAILABLE
END:VAVAILABILITY
END:VCALENDAR
</C:calendar-availability>

7.2.5. iTIP Free-Busy Requests

the CalDAV calendar-auto-schedule feature (see Section 5 of [RFC6638]) has a mechanism for requesting free-busy info over the CalDAV protocol ๐Ÿ“จ any VAVAILABILITY components in any calendar collections targeted during such a request MUST be included in the overall free-busy calculation. on top of that, the VAVAILABILITY component in the CALDAV:calendar-availability property on the owner's Inbox MUST also be included in the free-busy calculation. all of these VAVAILABILITY components get processed the same way, as per Section 5 ๐Ÿซถ

8. Security Considerations ๐Ÿ”’๐Ÿ’€

okay, this part is serious bestie. calculating availability gets complicated fast, especially with multiple overlapping time ranges, so CalDAV servers MUST limit how complex the availability data a client stores can be ๐Ÿ™ˆ

an attacker who can "inject" availability info into someone's calendar data could make sure that user never looks free for meetings, or looks free at the worst possible times. that's a whole disaster โ˜ ๏ธ calendar systems MUST ensure that availability info for a calendar user can only be changed by authorized users ๐Ÿ”

the security considerations in [RFC5545], [RFC5546], [RFC4791], [RFC6638], and [RFC7809] MUST also be followed ๐Ÿ›ก๏ธ

9. Privacy Considerations ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿฆ‹

free-busy and availability info can be used by attackers to figure out where someone is or how "active" they are overall ๐Ÿ‘€ any calendar system that lets a user expose their free-busy and availability info MUST limit access to that info to only authorized users ๐Ÿ”’

when VAVAILABILITY components get sent to or shared with other calendar users, be careful not to expose more than each recipient needs. for example, a business owner probably doesn't want customers knowing where they are or what they're doing, but family members might be fine sharing that with each other ๐Ÿ’… so calendar systems that let VAVAILABILITY components be sent or shared to other calendar users MUST provide a way to remove nonessential properties (e.g., SUMMARY, LOCATION, and DESCRIPTION) ๐ŸŽ€

iCalendar VFREEBUSY info generated from VAVAILABILITY components MUST NOT include anything other than busy or free time periods. in particular, user-specified property values such as SUMMARY, LOCATION, and DESCRIPTION MUST NOT be copied into the free-busy result data ๐Ÿ™…โ€โ™€๏ธ

the privacy considerations in [RFC5545], [RFC5546], [RFC4791], [RFC6638], and [RFC7809] MUST also be followed ๐ŸŒ™

10. IANA Considerations ๐ŸŒˆ๐Ÿ“š

10.1. Component Registrations

This document defines the following new iCalendar components, which have been added to the registry defined in Section 8.3.1 of [RFC5545] โœจ

+---------------+---------+------------------------+
| Component     | Status  | Reference              |
+---------------+---------+------------------------+
| VAVAILABILITY | Current | RFC 7953, Section 3.1  |
| AVAILABLE     | Current | RFC 7953, Section 3.1  |
+---------------+---------+------------------------+

10.2. Property Registrations

This document defines the following new iCalendar properties, which have been added to the registry defined in Section 8.3.2 of [RFC5545] ๐Ÿ’–

+----------+---------+------------------------+
| Property | Status  | Reference              |
+----------+---------+------------------------+
| BUSYTYPE | Current | RFC 7953, Section 3.2  |
+----------+---------+------------------------+

11. Normative References โœจ

okay bestie, these are the docs this whole spec leans on, so they're the homework you actually need ๐Ÿ“š๐Ÿซถ


Appendix A. Example Calendar #1 ๐Ÿ—“๏ธ

okay this one is giving busy Monday energy ๐Ÿ’ผ there's a meeting, and then there's a recurring availability block that's basically "I'm free 8 to 6, weekdays only" ๐Ÿ™ˆ

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//example.com//iCalendar 2.0//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20111113T044111Z
DTSTART;TZID=America/Montreal:20111106T120000
DURATION:PT2H
SUMMARY:Meeting
UID:768CB0C2-8642-43F7-A6C4-F8BB04B829B4
END:VEVENT
BEGIN:VAVAILABILITY
UID:452DFCA7-3203-4A3D-9A9A-99753A383B41
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
BEGIN:AVAILABLE
UID:466D5C68-5C4A-4078-AF5D-9C55EA9145D7
SUMMARY:Monday to Friday from 8:00 to 18:00
DTSTART;TZID=America/Montreal:20111002T080000
DTEND;TZID=America/Montreal:20111002T180000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
END:AVAILABLE
END:VAVAILABILITY
END:VCALENDAR

Appendix B. Example Calendar #2 ๐ŸŒธ

this one is a whole travel era ๐Ÿงณโœˆ๏ธ there's a lunch meeting in Denver, and then TWO availability blocks from two different organizers. one is Montreal hours, the other is Denver hours for one specific week. the way the second block has PRIORITY:1 and the dates are scoped to just that weekโ€ฆ it's giving very intentional scheduling ๐Ÿ’…

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//example.com//iCalendar 2.0//EN
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20111113T044111Z
DTSTART;TZID=America/Denver:20111106T120000
DURATION:PT2H
SUMMARY:Lunch meeting in Denver
UID:2346C09A-42BF-439E-916C-FC83AF869171
END:VEVENT
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:627A87FA-E5F1-43C0-B3B1-567DA10F2A83
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Montreal:20111002T000000
BEGIN:AVAILABLE
UID:A833E850-892B-43F6-98B6-C15A6BFC5D27
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Montreal:20111002T080000
DTEND;TZID=America/Montreal:20111002T180000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Montreal
END:AVAILABLE
END:VAVAILABILITY
BEGIN:VAVAILABILITY
ORGANIZER:mailto:bernard@example.com
UID:F01411E3-38B8-4490-8A1F-0CCEC57A0943
DTSTAMP:20111005T133225Z
DTSTART;TZID=America/Denver:20111023T000000
DTEND;TZID=America/Denver:20111030T000000
PRIORITY:1
BEGIN:AVAILABLE
UID:A35AA091-3846-48ED-96F6-881E8A0D0A93
SUMMARY:Monday to Friday from 9:00 to 17:00
DTSTART;TZID=America/Denver:20111023T080000
DTEND;TZID=America/Denver:20111023T180000
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
LOCATION:Denver
END:AVAILABLE
END:VAVAILABILITY
END:VCALENDAR

Acknowledgements ๐Ÿซถ

big thank you to the people who gave feedback, bestie ๐Ÿ’– Toby Considine, Bernard Desruisseaux, Alexey Melnikov, Daniel Migault, Ken Murchison, Evert Pot, and Dave Thewlis are all iconic for that ๐Ÿ‘‘ and this whole spec came out of discussions at the Calendaring and Scheduling Consortium, so shoutout to them too ๐ŸŒˆ


Authors' Addresses ๐Ÿฆ‹

these are the two people who wrote it, so here's where to find them โœจ

Cyrus Daboo
Apple Inc.
1 Infinite Loop
Cupertino, CA  95014
United States of America

Email: cyrus@daboo.name
URI:   http://www.apple.com/


Michael Douglass
Spherical Cow Group
226 3rd Street
Troy, NY  12180
United States of America

Email: mdouglass@sphericalcowgroup.com
URI:   http://sphericalcowgroup.com

and that's a wrap on RFC 7953, literally so good ๐ŸŒˆ๐Ÿ’œ๐ŸŽ€

๐Ÿ“ฆ where this page comes from