mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +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;
|
function DayOfWeek(DateTime: TDateTime): integer;
|
||||||
begin
|
begin
|
||||||
Result := 1 + (Abs(Trunc(DateTime) - 1) mod 7);
|
Result := 1 + ((Trunc(DateTime) - 1) mod 7);
|
||||||
end ;
|
If (Result<=0) then
|
||||||
|
Inc(Result,7);
|
||||||
|
end;
|
||||||
|
|
||||||
{ Date returns the current Date }
|
{ Date returns the current Date }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user