On Feb 20, 12:55 pm, gfo...@gmail.com wrote:
> I want to create (or find) a perl script that can take a start date,
> an end date, and a set of "off days" and output an iCalendar
> compatible file where each date in the iCalendar is marked as a DAY
> 1-6 or an off day.
.....
> I'm currently looking at DateTime::Format::ICal.
DateTime::Format::ICal will allow you to create the iCalendar output,
but it won't help you parse the dates.
For that, I'd recommend Date::Manip (the Swiss Army Knife of date
manipulation). The DateCalc() method allows you to use "business
mode" which takes into account the duration of the work (or school)
week, holidays, etc (and all these things can be custom configured).
The module has many methods which may be of interest to you. For
example, if you want to iterate over a date range of work days you can
do so with the Date_NextWorkDay() method. The Date_IsHoliday() method
will tell you if any particular date is a holiday. Lots of other good
things.
--
The best way to get a good answer is to ask a good question.
David Filmer (
http://DavidFilmer.com)