evrythng / epcis2.js

EPCIS 2.0 Javascript SDK
Apache License 2.0
35 stars 4 forks source link

corrected polarity of default timezone offset #44

Closed RyanWhipple closed 1 year ago

RyanWhipple commented 1 year ago

The calculation of default timeZoneOffsets currently returns + when it should be - and vice-versa. This is because .getTimezoneOffset() returns a positive value for negative timezones and vice-versa.

Changing: const timeZoneOffset = getTimeZoneOffset(date.getTimezoneOffset() / 60); to: const timeZoneOffset = getTimeZoneOffset(-(date.getTimezoneOffset()) / 60); accounts for this reversal.

This corrects three scenarios: