|
From: gfoyle on 20 Feb 2007 15:55 I work at a school where we have repeating events over a six day school cycle. So we have classes on Day 1 that repeat on the next school day after Day 6. Our school days are Monday through Friday, with days off for holidays and what not. For example if our school year started on August 30, 2007, that would be DAY 1. August 31, 2007, would be DAY 2. There is no school on the weekend and the following Monday is Labor Day, so September 4, 2007, would be DAY 3. Etc., etc. till you get to the end date. This makes it very difficult to use regular calendars to schedule events, because they all assume things repeat on a daily, weekly, or monthly basis. 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. With this script, I will be able to label each day (DAY 1, DAY 2, etc.) and put in my classes. For me, weekends would always be off-days, but it would be nice to be able to turn off this assumption. If you know of a project that is already working on this, please share it with me. If you can recommend some CPAN modules that would be helpful for me to build this script, it would be much appreciated. I'm currently looking at DateTime::Format::ICal. Thank you for your assistance, Gully.
From: usenet on 20 Feb 2007 16:25 On Feb 20, 12:55 pm, gfo...(a)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)
|
Pages: 1 Prev: Help with string replacement Next: simple use of eval of somethinng else |