DatesInSameWeekNo Function
Returns true if the two Dates are in the same WeekNo.

Unit
QESBPCSDateTime

Declaration
Function DatesInSameWeekNo(const DT1, DT2: TDateTime): Boolean;

Description
Will return false if Dates from Different Years.

Parameters
DT1 First Date/Time to be processed.
DT2 Second Date/Time to be processed.

Category
Date/Time Arithmetic Routines
Week Based Arithmetic Routines
Date/Time Comparison

Implementation

function DatesInSameWeekNo (const DT1, DT2: TDateTime): Boolean;
begin
     if Date2Year (DT1) <> Date2Year (DT2) then
          Result := False
     else
          Result := Date2WeekNo (DT1) = Date2WeekNo (DT2);
End;


HTML generated by Time2HELP
http://www.time2help.com