Date::HolidayParser::iCalendar - iCalendar-like interface extension to Date::HolidayParser


Date-HolidayParser documentation  | view source Contained in the Date-HolidayParser distribution.

Index


VERSION

Top

0.4

SYNOPSIS

Top

This is an extension to Date::HolidayParser that adds an iCalendar-like interface to the holiday data.

	use Date::HolidayParser;

	my $Holidays = Date::HolidayParser->new("$ENV{HOME}/.holiday");

	...

DESCRIPTION

Top

This is an extension to Date::HolidayParser that adds an interface that provides iCalendar-compatible data instead of the normal "raw" Date::HolidayParser format.

It ensures that UIDs generated are always the same, so you can depend upon them not changing between runs. The iCalendar data generated at the moment is very simple, and doesn't take into account recurrances (recurring events gets one event created per recurrance).

METHODS

Top

You can run any method Date::HolidayParser supports on a Date::HolidayParser::iCalendar object (but then you should probably be using Date::HolidayParser instead). The methods documented here are all those needed to make use of Date::HolidayParser::iCalendar.

$object = Date::HolidayParser::iCalendar->new(FILE);

This is the main function. It creates a new Date::HolidayParser::iCalendar object for FILE and parses the file.

FILE must be the full path to the holiday file you want to parse.

$arrayRef = $object->list_events(YEAR,MONTH?,DAY?);

This returns an arrayRef, which contains one of three lists, depending on how many parameters are supplied:

Only year: An array containing a list of months (1-12) that has holidays
Year+Month: An array of days in said month that has holidays
All: A list of iCalendar UIDs referring to holidays on said date. These UIDs can be supplied to get_info() to retrieve the event.

$UID_Info = $object->get_info(UID);

Returns an iCalendar hash reference for the supplied UID or undef if the UID doesn't exist.

The hash returned is structured like this:

	%Hash = (
		ICAL_ENTRY => "ENTRY_VALUE",
		ANOTHER_ENTRY => "ANOTHER_VALUE",
	);

An example might look like this:

	%Hash = (
		'SUMMARY' => 'Monday',
		'UID' => 'D-HP-ICS-72-106-616',
		'DTEND' => '20060313',
		'DTSTART' => '20060313'
	);

AUTHOR

Top

Eskild Hustvedt - <zerodogg@cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-date-holidayparser@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Date-HolidayParser. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

LICENSE AND COPYRIGHT

Top


Date-HolidayParser documentation  | view source Contained in the Date-HolidayParser distribution.