* Fix day names in formatdatetime, fix DateTimeToJSDate

This commit is contained in:
michael 2019-09-30 13:48:08 +00:00
parent 509b6ee185
commit 9640756fc2

View File

@ -2362,7 +2362,7 @@ Var
begin
DecodeDate(Trunc(aDateTime),Y,M,D);
DecodeTime(Frac(aDateTime),H,N,S,Z);
Result:=TJSDate.New(Y,M,D,h,n,s,z);
Result:=TJSDate.New(Y,M-1,D,h,n,s,z);
end;
function JSDateToDateTime(aDate: TJSDate): TDateTime;
@ -2567,7 +2567,7 @@ end ;
function DayOfWeek(DateTime: TDateTime): integer;
begin
Result := 1 + ((Trunc(DateTime) - 1) mod 7);
Result:= 1+((Trunc(DateTime) - 1) mod 7);
If (Result<=0) then
Inc(Result,7);
end;
@ -3313,8 +3313,8 @@ var
case Count of
1: StoreInt(Day, 0);
2: StoreInt(Day, 2);
3: StoreString(ShortDayNames[DayOfWeek]);
4: StoreString(LongDayNames[DayOfWeek]);
3: StoreString(ShortDayNames[DayOfWeek-1]);
4: StoreString(LongDayNames[DayOfWeek-1]);
5: StoreFormat(ShortDateFormat, Nesting+1, False);
else
StoreFormat(LongDateFormat, Nesting+1, False);