NAME
PlotCalendar::DateDesc - Perl extension for interpreting a file of periodic (like weekly) events and assigning actual dates to them. Used to feed the calendar plotting software.
SYNOPSIS
require PlotCalendar::DateDesc;
my ($month, $year) = (3,1999);
# ---- set the month and year
my $trans = PlotCalendar::DateDesc->new($month, $year);
# ---- parse a description and return the day of the month
my $day = 'first monday and third monday';
print "$day : ",join(',',@{$trans->getdom($day)}),"\n";
$day = 'last monday and third monday';
print "$day : ",join(',',@{$trans->getdom($day)}),"\n";
$day = 'last fri and third Monday';
print "$day : ",join(',',@{$trans->getdom($day)}),"\n";
# ---- parse a description and return the date as mm/dd/yyyy
$day = 'last fri and third Monday';
print "$day dates: ", join(',',@{$trans->getdates($day)}),"\n";
What gets returned by both routines is a pointer to an array of answers
DESCRIPTION
input descriptions may be one of :
a day of the week (monday, tuesday, etc)
a qualified day of the week (first monday, second tuesday, last sunday)
compound statements are allowed : mon and wed, first mon and third mon
Qualifiers are : first, second, third, fourth, fifth, last
Compounds are only formed with 'and' and are not associative
AUTHOR
Alan Jackson
March 1999
ajackson@icct.net
SEE ALSO
PlotCalendar::Month PlotCalendar::Day