Re: [calsify] SKIP was Re: AD review of draft-ietf-calext-rscale-03

Ken Murchison <murch@andrew.cmu.edu> Wed, 04 February 2015 13:20 UTC

Return-Path: <murch@andrew.cmu.edu>
X-Original-To: calsify@ietfa.amsl.com
Delivered-To: calsify@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 577301A87EC for <calsify@ietfa.amsl.com>; Wed, 4 Feb 2015 05:20:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.609
X-Spam-Level:
X-Spam-Status: No, score=-3.609 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, J_CHICKENPOX_47=0.6, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ndKCTtJcgVrH for <calsify@ietfa.amsl.com>; Wed, 4 Feb 2015 05:20:42 -0800 (PST)
Received: from smtp.andrew.cmu.edu (SMTP.ANDREW.CMU.EDU [128.2.105.203]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E02161A87EB for <calsify@ietf.org>; Wed, 4 Feb 2015 05:20:41 -0800 (PST)
Received: from localhost.localdomain (cpe-76-180-151-43.buffalo.res.rr.com [76.180.151.43]) (user=murch mech=PLAIN (0 bits)) by smtp.andrew.cmu.edu (8.14.8/8.14.8) with ESMTP id t14DKZrD025899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 4 Feb 2015 08:20:35 -0500
Message-ID: <54D21CA2.5020807@andrew.cmu.edu>
Date: Wed, 04 Feb 2015 08:20:34 -0500
From: Ken Murchison <murch@andrew.cmu.edu>
Organization: Carnegie Mellon University
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: Marten Gajda <marten@dmfs.org>, Cyrus Daboo <cyrus@daboo.name>, calsify@ietf.org
References: <68FCD7D11F934509267D5915@cyrus.local> <CALaySJKQP9WjRQV2qrgfLiGwj-SQAUCF6RVcQuRrUYNpfqp17A@mail.gmail.com> <7FF77F2FE3390FFD1149E953@cyrus.local> <CALaySJK3RiXXHTq9MC4nwA4c_gZzEVDoWa96MDc7Ue4yDRgbWA@mail.gmail.com> <C80A141CD062EFF630B6D2BB@caldav.corp.apple.com> <54D0E2E9.2030505@andrew.cmu.edu> <99B9DDB4AEFC12755724C5DD@caldav.corp.apple.com> <54D107AC.3050706@andrew.cmu.edu> <2D953326EFEE238B1CCF867E@caldav.corp.apple.com> <54D10C50.20909@andrew.cmu.edu> <54D10FDB.6070001@andrew.cmu.edu> <54D12AAC.7000202@dmfs.org> <54D12E31.4020506@andrew.cmu.edu> <55A07C99191DC58DAAA160D5@caldav.corp.apple.com> <54D1368F.2000501@dmfs.org> <6BD446FBAB897BCD227A82F1@caldav.corp.apple.com> <54D14289.90201@dmfs.org>
In-Reply-To: <54D14289.90201@dmfs.org>
Content-Type: multipart/alternative; boundary="------------070908030407060605020407"
X-PMX-Version: 6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.2.4.131220
X-SMTP-Spam-Clean: 28% ( SXL_IP_DYNAMIC 3, HTML_NO_HTTP 0.1, BODYTEXTH_SIZE_10000_LESS 0, DATE_TZ_NA 0, FROM_EDU_TLD 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_RESIDENTIAL 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, REFERENCES 0, __ANY_URI 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_ALT 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_HTML 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __RDNS_POOLED_1 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_NEGATE 0, __TAG_EXISTS_HTML 0, __TO_MALFORMED_2 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0)
X-SMTP-Spam-Score: 28%
X-Scanned-By: MIMEDefang 2.74 on 128.2.105.203
Archived-At: <http://mailarchive.ietf.org/arch/msg/calsify/o-m7KN1fe9PvQwqDSlo1jJEjCb8>
Subject: Re: [calsify] SKIP was Re: AD review of draft-ietf-calext-rscale-03
X-BeenThere: calsify@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <calsify.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/calsify>, <mailto:calsify-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/calsify/>
List-Post: <mailto:calsify@ietf.org>
List-Help: <mailto:calsify-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/calsify>, <mailto:calsify-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Feb 2015 13:20:44 -0000

On 02/03/2015 04:50 PM, Marten Gajda wrote:
>
> Am 03.02.2015 um 22:04 schrieb Cyrus Daboo:
>> I think Ken's idea is that you apply the SKIP after BYMONTH only if 
>> the invalid data corresponds to an invalid leap month as opposed to a 
>> leap day. In which case the SKIP would not have applied after BYMONTH 
>> in your example. But I think a behavior like that is going to be 
>> really tricky for implementors to get right and hard to describe 
>> really well without having to delve into the gory details of RRULE 
>> processing.
>>
> Ah, got it.
>
> So, considering the following
>
> Applying SKIP=FORWARD after BYDAY on the following rule
>
> FREQ=YEARLY;RSCALE=HEBREW;MONTHLY=5L;BYDAY=MO,TU,WE,TH,FR,SA,SU;SKIP=FORWARD
>
> results in 30 instances in leap years and in non-leap years, since it 
> would expand the week days in Adar I and roll them forward afterwards
>
> Applying SKIP=FORWARD after BYMONTH but before BYDAY results in 30 
> instances in leap years, but 29 instances in non-leap years, since the 
> weekdays would be expanded for Adar instead of Adar I.
>
> It's similar when the month following the leap month has more days 
> than the leap month itself.
>
> In essence, applying SKIP after all BYxxx parts won't change the 
> number of instances (given they don't fall on another instance), but 
> Ken's approach might do that.
>
> Not sure what's preferable in this case.

I'd argue that what this rule is asking for is all days of the leap 
month, but in non-leap years provide all days of the next month, so 30 
and 29 are correct respectively.

I'd also argue that BYMONTHDAY=30/31 should have different results from 
BYMONTHDAY=-1, in the same way that it does for GREGORIAN:


RRULE:FREQ=MONTHLY;RSCALE=GREGORIAN;SKIP=FORWARD;COUNT=12;BYMONTHDAY=31
DTSTART:20150131
INSTANCES:20150131,20150301,20150331,20150501,20150531,20150701,20150731,20150831,20151001,20151031,20151201,20151231

RRULE:FREQ=MONTHLY;RSCALE=GREGORIAN;SKIP=FORWARD;COUNT=12;BYMONTHDAY=-1
DTSTART:20150131
INSTANCES:20150131,20150228,20150331,20150430,20150531,20150630,20150731,20150831,20150930,20151031,20151130,20151231


So, my proposal is to tweak the BYxxx rule part processing order in RFC 
5545, Section 3.3.10 by inserting SKIP processing in the following way:

BYMONTH
SKIP (for invalid month only)
BYWEEKNO
BYYEARDAY
BYMONTHDAY
SKIP (for invalid day)
BYDAY
BYHOUR
BYMINUTE
BYSECOND
BYSETPOS
COUNT
UNTIL


By main argument here is that BYWEEKNO, BYYEARDAY, BYMONTHDAY should 
apply to a "real" month in all cases, and not a leap month in non-leap 
years.

This leads to the following for the Hebrew calendar:

RRULE:FREQ=YEARLY;RSCALE=HEBREW;SKIP=FORWARD;COUNT=5;BYMONTHDAY=30;BYMONTH=5L
DTSTART:20140302
INSTANCES:20140302 (30 Adar I), 20150321 (1 Nisan), 20160310 (30 Adar 
I), 20170328 (1 Nisan), 20180317 (1 Nisan)

RRULE:FREQ=YEARLY;RSCALE=HEBREW;SKIP=FORWARD;COUNT=5;BYMONTHDAY=-1;BYMONTH=5L
DTSTART:20140302
INSTANCES:20140302 (30 Adar I), 20150320 (29 Adar), 20160310 (30 Adar 
I), 20170327 (29 Adar), 20180316 (29 Adar)



-- 
Kenneth Murchison
Principal Systems Software Engineer
Carnegie Mellon University