At 3:24 PM -1000 16/6/03, Joshua Hoblitt wrote:
> > There must be a way to express the same semantic
> meaning with fewer lines of code

 A slightly smaller version - specify days and hours
 in the same constructor.

That is a bit clearer - although it's alot more code then I'd want to inline in a program. It's something I would push off into a module. So perhaps something like DT::W::Validator should just be a very simple base class.

Hang on a second .. isn't this all a part of DateTime::Event::BusinessDay?


if ($BusinessDayObject->is($dt)) {
        # It's in the range specified (and isn't a holiday, or a day off
        # as defined in the object
}

I know DT::E::BusinessDay isn't written yet, but that's where the code should go for such a validator. Easter works in this way:

$GoodFriday = DateTime::Event::Easter->new(day => 'Good Friday');
unless ($GoodFriday->is($today)) {
        eatMeat();
}

--
--------------------------------------------------------
            There are 10 kinds of people:
  those that understand binary, and those that don't.
--------------------------------------------------------
  The day Microsoft makes something that doesn't suck
    is the day they start selling vacuum cleaners
--------------------------------------------------------
"Write a wise proverb and your name will live forever."
   -- Anonymous
--------------------------------------------------------

Reply via email to