mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 20:39:43 +02:00
* Fix dayOfWeek for dates < 0 (bug ID #23144)
git-svn-id: trunk@22679 -
This commit is contained in:
parent
1cfb612513
commit
9d6b4aa946
@ -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 }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user