On Wed, 16 Oct 2002, Shevek wrote:
> On Wed, 16 Oct 2002, Rafiq Ismail (ADMIN) wrote:
> This question is underspecified. Two points cannot intersect unless they
> are coincident points. Define the endpoints of your ranges. I'm assuming
> that date_a and date_b are just point dates.
Indeed, however I did under specify (see below).
> > (yyyy,mm?,dd?) and turned into days since epoch using Date::Calc which is
> What is the '?'? Is this a regular expression?
This bit is unimportant, since the dates are converted to epoch first.
> > We can do it with three tests on the boundaries, however I'm curious if it
> What boundaries?
1) We actually have $intervalStart and $intervalEnd, marking a period in
time, where $intervalEnd >= $intervalStart.
2) We also have:
$startTest and $startEnd.
3)
Is there a more affective way of saying - summarised:
return 1 if ( ($startTest <= $intervalStart &&
$endTest >= $intervalStart)
||
($startTest <= $intervalEnd &&
$endTest >= $intervalEnd)
||
($startTest >= $intervalStart &&
$endTest <= $intervalEnd)
) );
I think. It really does my head in.
Cheers,
Rafiq