mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-10 09:09:17 +02:00
* Correct offset
This commit is contained in:
parent
e22ce77bcb
commit
b820cc3041
@ -48,6 +48,7 @@ Type
|
||||
function GetDecimalSeparator(aSeparator: TWasmPointer; aSeparatorLen: TWasmPointer): TLocaleError;
|
||||
function GetThousandSeparator(aSeparator: TWasmPointer; aSeparatorLen: TWasmPointer): TLocaleError;
|
||||
function GetCurrencySymbol(aSymbol: TWasmPointer; aSymbolLen: TWasmPointer): TLocaleError;
|
||||
// Follows Javascript getTimezonOffset convention (UTC+3 is -180)
|
||||
function GetTimeZoneOffset : Integer;
|
||||
procedure InitAll;
|
||||
procedure InitTimeSeparator;
|
||||
@ -117,7 +118,7 @@ end;
|
||||
|
||||
function TWasmLocaleAPI.GetTimeZoneOffset: Integer;
|
||||
begin
|
||||
Result:=TJSDate.New.getTimezoneOffset();
|
||||
Result:=-TJSDate.New.getTimezoneOffset();
|
||||
end;
|
||||
|
||||
procedure TWasmLocaleAPI.InitAll;
|
||||
@ -378,9 +379,9 @@ begin
|
||||
offsetMinutes := absOffsetMinutes mod 60;
|
||||
|
||||
if (timezoneOffsetMinutes < 0) then
|
||||
posixOffsetString := '-'
|
||||
posixOffsetString := '+'
|
||||
else
|
||||
posixOffsetString := '+';
|
||||
posixOffsetString := '-';
|
||||
posixOffsetString := posixOffsetString + IntToStr(offsetHours);
|
||||
if (offsetMinutes > 0) then
|
||||
posixOffsetString := ':' + posixOffsetString +Format('%.2d',[offsetMinutes]);
|
||||
|
Loading…
Reference in New Issue
Block a user