Interesting, I had no idea you were doing this. And thanks for stealing my thunder! :) After you publish it, someone will have to compare the different versions (speed, memory, ease of use, etc).
From: "Alan Lovejoy" squeak-dev.sourcery@forum-mail.net Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: [ANN] ICal occurrence API Date: Mon, 28 May 2007 12:21:26 -0700
<JJ (Jason)> Features:
- To my knowledge this is the most compliant implementation of
Recurrence rules
- Full support for Exclusion dates and exclusion rules (!)
</JJ (Jason)>
The next release of Chronos will have full support for recurrence rules based on the iCal rule model--including exclusion dates and exclusion rules.
The implementation is based on a recurrence rule algebra, so that recurrence rules can be specified using algegraic expressions, which are then evaluated according to a recurrence rule algebra.
Example:
(RecurrenceSet from: (2007 month: #February day: 9)) add: (RecurrenceRule delta: 1 years count: 10 temporalExpression: ((WeekOfMonth week: 0) & (#Sunday asDayOfWeek | #Saturday asDayOfWeek) not) occurrenceIndices: #(0)); "Chronos uses 0 as the ordinal of the last value or element." do: [:each | Transcript cr; show: each % #rfc2822]
The iCal expression that specifies the same thing:
DTSTART;TZID=America/Los_Angeles:2007-02-09 RRULE:FREQ=YEARLY;COUNT=10;BYDAY=-1MO,-1TU,-1WE,-1TH,-1FR;BYSETPOS=-1
The output:
Wed, 28 Feb 2007 Fri, 29 Feb 2008 Fri, 27 Feb 2009 Fri, 26 Feb 2010 Mon, 28 Feb 2011 Wed, 29 Feb 2012 Thu, 28 Feb 2013 Fri, 28 Feb 2014 Fri, 27 Feb 2015 Mon, 29 Feb 2016
--Alan
_________________________________________________________________ Make every IM count. Download Messenger and join the im Initiative now. Its free. http://im.live.com/messenger/im/home/?source=TAGHM_MAY07
<JJ (Jason)>Interesting, I had no idea you were doing this. And thanks for stealing my thunder! :) After you publish it, someone will have to compare the different versions (speed, memory, ease of use, etc).</JJ (Jason)>
I fully intend to have a look at your code--after I've completed my implementation. However, I don't plan on implementing a parser for iCal--the only goal is to be able to specify/represent (and fully and correctly implement) the iCal rule model. Actually, the Chronos recurrence rule model goes beyond what can be specified using the iCal rule model/notation. Using an algebra enables support for logical negation and disjunction, among other things (consider what Chalten does with its TimeLineFilter, for example.)
I'm also working on full support for business date arithmetic. I intend to meet or exceed the capabilities offered by jFin (http://jfin.org/date_adjustment) or ObjectLab (http://objectlabkit.sourceforge.net/), and to use the data provided by FinancialCalendar.com (http://financialcalendar.com/).
As for "thunder stealing," that goes with the territory when two or more projects are in the same functional domain. My goal is to implement the world's best date/time library in any language--and I've been working hard at it since October 2004. I feel I've already achieved parity with anything else out there. Now it's time to go to the next level.
But, since my main motivation for making Chronos the best date/time library in the world is to help promote Smalltalk, I actually welcome any and all contributions by others to that goal. And based on the description, your iCal engine certainly seems to be a worthy contribution.
Working together, we can leave Smalltalk's competition in the dust. And inspire those working on Smalltalk projects in domains other than dates/times to do the same.
Go Smalltalk!
--Alan
squeak-dev@lists.squeakfoundation.org