[Omaha.pm] [pm_groups] Calculate next meeting date

Jay Hannah jay at jays.net
Wed May 3 14:59:48 PDT 2006


:)

j


-------- Original Message --------
From: Flavio S. Glock <fglock at pucrs.br>
To: Jay Hannah <jay at jays.net>
CC: pm_groups at pm.org

Jay Hannah wrote:
> This is a pretty slick combination of Date::Calc and Class::Date, IMHO:
> 
> http://omaha.pm.org/nextmtg_pl.txt
> 
>    (In action: http://omaha.pm.org)
> 
> Anyone have a tighter version?  :)

----
#!/usr/bin/perl
#
# Our meetings are held the 2nd Tuesday of every month. Figure out when
# the next meeting is.

use DateTime;
use DateTime::Event::ICal;

my $set = DateTime::Event::ICal->recur(
     freq =>    'monthly',
     byday =>   '2tu',
);

my $dt = DateTime->today;

my $dt_next = $set->next( $dt );
print $dt_next;
----

- Flavio S. Glock


More information about the Omaha-pm mailing list