Combining M-F school week and 6 day class cycle

Discussion in 'Perl Misc' started by gfoyle@gmail.com, Feb 20, 2007.

  1. Guest

    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.
    , Feb 20, 2007
    #1
    1. Advertising

  2. Guest

    On Feb 20, 12:55 pm, 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)
    , Feb 20, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    3
    Views:
    1,827
    Alexandre
    Dec 22, 2003
  2. jack
    Replies:
    0
    Views:
    373
  3. Andy
    Replies:
    1
    Views:
    682
  4. Guest
    Replies:
    3
    Views:
    516
    Alexandre
    Dec 22, 2003
  5. Guest
    Replies:
    3
    Views:
    1,073
    Alexandre
    Dec 22, 2003
Loading...

Share This Page