* Fix dayOfWeek for dates < 0 (bug ID #23144)

git-svn-id: trunk@22679 -
This commit is contained in:
michael 2012-10-17 07:15:01 +00:00
parent 1cfb612513
commit 9d6b4aa946

View File

@ -220,8 +220,10 @@ end ;
function DayOfWeek(DateTime: TDateTime): integer;
begin
Result := 1 + (Abs(Trunc(DateTime) - 1) mod 7);
end ;
Result := 1 + ((Trunc(DateTime) - 1) mod 7);
If (Result<=0) then
Inc(Result,7);
end;
{ Date returns the current Date }