Hello all,
I just published a new version of ICal (well a couple, ignore the first jbjohns) that now supports querying what occurences of an event are described by a recurrence rule. The public API consists of the following 6 methods. ICEvent>>occurrences ICEvent>>occurrencesAfter: aTimeSpan ICEvent>>occurrencesBetween: aStartTimeSpan and: anEndTimeSpan ICEvent>>occurrences: aNumber ICEvent>>occurrences: aNumber after: aTimeSpan ICEvent>>occurrences: aNumber between: aStartTimeSpan and: anEndTimeSpan The first two require the rule to have a count or until directive, since otherwise the set would be infinite (I will consider infinite sets later :) ). All methods are constrained by the rule (i.e. if the rule has a count directive of 4 then occurrences: 6 will still return only 4). The ICEvent>>isValidForDate: method was also changed, so that it checks if the given date is in the set. Things to be aware of: Right now the API only works for monthly recurrence rules, but I plan to put in more soon (I will be focusing on Weekly and above). The rest will spit out some "does not understand" messages for the occurrence methods, but otherwise, everything works as before. Right now the occurrence methods just return an ordered list of dates. I haven't decided yet what should be returned (just a DateAndTime, or maybe a complete event representing that day?) so I have just deferred for now. Let me know what would be the most useful to you. The classes wont change and the API listed above wont change, but the methods in the ICFrequency classes will be moved around some. BUG: If your ICEvent uses multiple rules and they have common dates between them, they will all be in the returned set (i.e. there can be multiples of the same date). I am thinking of using some other data structure then OrderedCollection to fix this problem, and remove the need for sorting to happen in various spots throughout. ExclusionRules are not handled at the moment. The methods are designed for TimeSpan resolution, but right now some of the lower level methods work on Date's. This should mostly be transparent, except that the set returned are Date's, instead of DateAndTime's like they should be. :) Thanks. Hope this is useful to someone. :) Jason _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Since my application doesn't take advantage of continuations, does it make
sense for me to want to disable the caches or make them smaller? How would I do this? -Carl Gundel, author of Liberty BASIC http://www.libertybasic.com _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
2006/11/1, Carl Gundel <[hidden email]>:
> Since my application doesn't take advantage of continuations, does it make > sense for me to want to disable the caches or make them smaller? How would > I do this? Are you sure you don't use continuations? Do you never to a #call:, #answer: oder #returnResponse? Philippe _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> 2006/11/1, Carl Gundel <[hidden email]>:
>> Since my application doesn't take advantage of continuations, does it >> make >> sense for me to want to disable the caches or make them smaller? How >> would >> I do this? > > Are you sure you don't use continuations? Do you never to a #call:, > #answer: oder #returnResponse? Ah. I guess I do use continuations since I use the confirmation mechanism in a couple of places. -Carl Gundel, author of Liberty BASIC http://www.libertybasic.com _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |