Subject: [calsify] Proposed resolution to SKIP issue

From: Cyrus Daboo <[email-masked]>
Date: Thu, 05 Feb 2015 11:56:53 -0500

Hi,
OK, here is what I propose to resolve the SKIP issue.

1) Change to use OMIT instead of the YES value
2) Make OMIT be the default value when SKIP is not present
3) Add a new section describing SPLIT in much more detail.

Below is text I have drafted up for the new section:

4.1.  Skipping Invalid Dates

   In every calendar system only certain combinations of day-of-month
   and month values are valid for a given year. e.g., in the Gregorian
   calendar system January 31st is valid, but February 31st is not.
   Similarly, February 29th is valid in a leap year, but invalid in a
   non-leap year.  Other calendar systems can also include leap months
   (see Section 4.2) which vary from year to year.  This poses a problem
   for recurring events where the frequency of recurrence might give
   rise to an invalid date.  For example, a recurring event that starts
   on January 31st and is set to repeat monthly will generate invalid
   dates for months with fewer than 31 days.  The iCalendar [RFC5545]
   specification requires recurrence rule generators to ignore any
   invalid dates generated when iterating the rule.  However, that
   behavior might be surprising to a calendar user born on a leap day
   and whose birthday event only appears on their calendar every four
   years.  There are common conventions used by humans to determine what
   to do in such cases, but those conventions can differ from calendar
   system to calendar system, as well as within the same calendar
   system, depending on the nature of the event.  Typically, humans will
   expect the "missing" events to be moved to a earlier or later (valid)
   date.

   This specification introduces a new "RRULE" element, "SKIP", for use
   only when the "RSCALE" element is present.  The "SKIP" element allows
   the calendar user agent to specify new options for handling invalid
   dates.

      "SKIP=OMIT": this is the default option and corresponds to the
      existing iCalendar behavior of simply ignoring the invalid date.

      "SKIP=BACKWARD": when this option is set, a date with an invalid
      month is changed to the previous (valid) month.  A date with an
      invalid day-of-month is changed to the previous (valid) day-of-
      month.

      "SKIP=FORWARD": when this option is set, a date with an invalid
      month is changed to the next (valid) month.  A date with an
      invalid day-of-month is changed to the next (valid) day-of-month.

   Note that for both "BACKWARD" and "FORWARD", if the month is changed
   and results in an invalid day-of-month, then the skip behavior will
   be re-applied as per the day-of-month rules, according to the
   processing order defined below.

   The month and day-of-month skip behavior is only applied at specific
   points during the processing of an "RRULE" as determined by the order
   in which any "BYxxx" elements are processed.  The order is as follows
   (based on the "RRULE" element processing order defined in
   Section 3.3.10 of [RFC5545]):

   o  BYMONTH

   o  SKIP (for invalid month only)

   o  BYWEEKNO

   o  BYYEARDAY

   o  BYMONTHDAY

   o  SKIP (for invalid day)

   o  BYDAY

   o  BYHOUR

   o  BYMINUTE

   o  BYSECOND

   o  BYSETPOS

   o  COUNT

   o  UNTIL

   It is often possible to avoid having to deal with invalid dates by
   determining the real intent of a human user. e.g., a human creating a
   monthly recurring event that starts on January 31st, likely intends
   the event to occur on the last day of every month, in which case that
   could be encoded into an "RRULE" by using the "BYMONTHDAY=-1"
   element.

   Only a few types of recurrence patterns are likely to need the use of
   "SKIP".  The following is a list of some situations where it might be
   needed:

   1.  The start date of the recurrence is a leap day in the specified
       calendar system.

   2.  The start date of the recurrence is in a leap month in the
       specified calendar system.

   3.  The start date of the recurrence has a day-of-month value greater
       than the smallest day-of-month value for any month in any year in
       the specified calendar system.

   4.  A "BYMONTHDAY" element in an "RRULE" has a day-of-month value
       greater than the smallest day-of-month value for any month in any
       year in the specified calendar system.

   5.  A "BYMONTH" element in an "RRULE" has a value corresponding to a
       leap month in the specified calendar system.

   6.  A combination of "BYMONTHDAY" and "BYMONTH" elements in an
       "RRULE" have a value corresponding to a leap day in the specified
       calendar system.

   7.  A "BYYEARDAY" element in an "RRULE" has an absolute value greater
       than the smallest number of days in any year in the specified
       calendar system.

   8.  A "BYWEEKNO" element in an "RRULE" has an absolute value greater
       than the smallest number of weeks in any year in the specified
       calendar system.

   Examples of using "SKIP" for some common use cases appear in
   Section 4.3.

-- 
Cyrus Daboo

---

From: Gregory Yakushev <[email-masked]>
Date: Thu, 05 Feb 2015 22:39:28 +0000

The explanation is very clear, overall looks good to me. Thanks Cyrus!

Small comments below.

>       invalid day-of-month is changed to the next (valid) day-of-month.

A date with an invalid day-of-month is changed to the next day. This may
cause MONTH or YEAR to also increment. This behavior may cause two
instances to appear in a single month for a MONTHLY rule.

>    "SKIP".  The following is a list of some situations where it might be

I am not sure we need this exhaustive list here, given we already have an
examples section. Similarly the spec does not provide an exhaustive list of
usecases for other parameters (e.g. BYSETPOS).

> _______________________________________________
> calsify mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/calsify
>