fixing timezone header when it is negative value (#3732)

This commit is contained in:
Thiago Rodrigues 2024-03-15 08:40:27 -03:00 committed by GitHub
parent 6367626256
commit 8801ba625f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@ import { NocoBaseBuildInPlugin, Plugin } from '@nocobase/client';
const getCurrentTimezone = () => {
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;
};