Combining M-F school week and 6 day class cycle

G

gfoyle

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.
 
U

usenet

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top