Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Combining M-F school week and 6 day class cycle

Reply
Thread Tools

Combining M-F school week and 6 day class cycle

 
 
gfoyle@gmail.com
Guest
Posts: n/a
 
      02-20-2007
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.

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      02-20-2007
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)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Now.day and day(now) returning the wrong day! Andy ASP .Net 1 11-06-2008 12:20 PM
UR SCHOOL AND COLLEGE'S, PLEASE REGISTER UR SCHOOL AND COLLEGE NAME'SIN THIS SITE. "" IF U HAVE TIME THEN DO IT. PLEASE I REQUEST. """ jack Python 0 06-07-2008 06:34 AM
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook ASP .Net Web Controls 3 12-22-2003 10:42 PM
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook ASP .Net 3 12-22-2003 10:42 PM
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook ASP .Net Building Controls 3 12-22-2003 10:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57