mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
fixing timezone header when it is negative value (#3732)
This commit is contained in:
parent
6367626256
commit
8801ba625f
@ -2,7 +2,7 @@ import { NocoBaseBuildInPlugin, Plugin } from '@nocobase/client';
|
|||||||
|
|
||||||
const getCurrentTimezone = () => {
|
const getCurrentTimezone = () => {
|
||||||
const timezoneOffset = new Date().getTimezoneOffset() / -60;
|
const timezoneOffset = new Date().getTimezoneOffset() / -60;
|
||||||
const timezone = String(timezoneOffset).padStart(2, '0') + ':00';
|
const timezone = String(Math.abs(timezoneOffset)).padStart(2, '0') + ':00';
|
||||||
return (timezoneOffset > 0 ? '+' : '-') + timezone;
|
return (timezoneOffset > 0 ? '+' : '-') + timezone;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user