[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




:)

j


-------- Original Message --------
From: Flavio S. Glock <fglock@pucrs.br>
To: Jay Hannah <jay@jays.net>
CC: pm_groups@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