- DateTime::EventSet
At 5:33 PM -0500 22/3/03, [EMAIL PROTECTED] wrote:
I like this one.
Me too
At 5:33 PM -0500 22/3/03, [EMAIL PROTECTED] continued:
I propose the DateTime::Event semantics be changed to: "returns the _next_ event after the date"
Example: DateTime::Event::FourthJuly would be: 20030101 --> 20030604 20030603 --> 20030604 20030604 --> 20040604
Current semantics is "return the date in a given year".
(Which wouldn't work if the event were monthly)
My $0.02 on the event suite would be:
($dt is DateTime object for something like Sept 1, 2002)
$dt4jul = DateTime::Event::FourthJuly::next($dt) #20030704
$dt4jul = DateTime::Event::FourthJuly::previous($dt) #20020704
$dt4jul = DateTime::Event::FourthJuly::closest($dt) #20020704
And:
($dt1 is DateTime object for July 4, 2000, $dt2 is DateTime object for Sept 1, 2007)
$dt_set_4jul = DateTime::Event::FourthJuly::set(after=>$dt1, before=>$dt2) #20010704, 20020704, 20030704, 20040704, 20050704, 20060704, 20070704
My question is .. should they return midnight? If its noon on the 4th July and we ask for 'next' or 'set' do we include the current? Probably not. But if we return midnight, does 'previous' return the current? Really shouldn't.
What does a multi-day event return? For example, we could use the timezone to determine 'season' .. does previous return the last day of the previous season? Does 'next' return the first of the next ...
Cheers! Rick
--
--------------------------------------------------------
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
--------------------------------------------------------
