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