| DayName2DOW Function | 
Unit
QESBPCSDateTime
Declaration
Function DayName2DOW(const DayName: string): Byte;
Description
So for English Names, 'T' would return 3 for 'Tuesday'.
| Parameters | 
| DayName | Name of the Day of Week to search for. | 
Returns
the DOW Number, 1 through 7 - 0 implies not found. 1 is Sunday.
Category
Date/Time Conversion RoutinesImplementation
 
| function DayName2DOW (const DayName: string): Byte;
var
     I: Integer;
     Len: Integer;
     DN: string;
begin
     Result := 0;
     if DayName = '' then
          Exit;
     Len := Length (DayName);
     DN := AnsiUpperCase (DayName);
     for I := 1 to 7 do
     begin
          if AnsiUpperCase (LeftStr (ShortDayNames [I], Len)) = DN then
          begin
               Result := I;
               Exit;
          end;
     end;
     for I := 1 to 7 do
     begin
          if AnsiUpperCase (LeftStr (LongDayNames [I], Len)) = DN then
          begin
               Result := I;
               Exit;
          end;
     end;
End; | 
|  |