On Tue, 11 Sep 2001, Winfried Truemper wrote:
>
>
> On Mon, 10 Sep 2001, srl wrote:
>
> > Have you looked at Date::ICal?
>
> Thanks for the pointer. I didn't found this on my CPAN mirror.
Hmm. I wonder what's up with that. If you can't locate a copy, I'd be
glad to send you one. Or you can get it at
http://reefknot.sourceforge.net/ Looks like I need to upload the latest
version there.
And it is available out of CVS on sourceforge, if you want to submit
patches! :-)
> I hope that Date::ICal does all I want so I can save the time porting
> routines from an old perl script. :)
>
> What I want to do is "next month" in an object oriented fashion. ICal
> would allow me to do this:
>
> my $month = $ical->month();
> $month += 1; # may become 13
> $ical->month($month); # one could add this functionality
Actually, Date::ICal does not do this, although we discussed it for
quite some time. The difficulty is knowing how long a month is. That may
sound like a silly question, but when you are dealing with non-gregorian
calendars that either don't have months, or have different-looking
months, it's hard to know what adding a month means.
However, that is a little bit of a cop-out, and hopefully we'll stop
waffling on this some time soon and add that functionality.
The syntax, by the way, looks more like:
$ical->add( month => 1 );
Or you can do stuff like:
$ical->add( week=>2, day=> 3, month=>-3 );
Except that the 'month' part of that does not actually work yet.
> That should also be possible with Time-Objects. Or am I missing
> something? Just for my understanding, could ICal be made an extension
> for Time-Objects by adding the parsing routines for the ICal-format?
I suppose it's possible. However, I've also been asked to make it an
extension of every other date/time/oo/class object out there. Although I
had grand schemes of making this the universal date subclass, what it
has evolved into is more of just an ICal module, which certain other
modules that need ICal-ish things have subclassed off of. ICal is a
really convenient format for stuff like this.
> With my module, you just say $month->next(); regardless of the month. It
> is the navigation in time I'm interested in. $time->month() is nothing I
> paid special attention to so far.
Your syntax for all of this is really cool. Can we convince you to join
us in the Reefknot discussion and implement some of these in existing
modules? I'd rather see us extend something that is already out there
than add something else to the witches' brew.
--
Rich Bowen - [EMAIL PROTECTED]
... and another brother out of his mind, and another brother out at New
York (not the same, though it might appear so)
Somebody's Luggage (Charles Dickens)