date-fns-tz
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -86,5 +86,6 @@ "use strict"; | ||
function getTimeZoneOffset(timeZone, originalDate) { | ||
var _a; | ||
const timeZoneOffset = timeZone | ||
? (0, index_js_2.tzParseTimezone)(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE | ||
: originalDate.getTimezoneOffset(); | ||
: ((_a = originalDate === null || originalDate === void 0 ? void 0 : originalDate.getTimezoneOffset()) !== null && _a !== void 0 ? _a : 0); | ||
if (Number.isNaN(timeZoneOffset)) { | ||
@@ -91,0 +92,0 @@ throw new RangeError('Invalid time zone specified: ' + timeZone); |
@@ -85,3 +85,3 @@ import { tzIntlTimeZoneName } from '../../_lib/tzIntlTimeZoneName/index.js'; | ||
? tzParseTimezone(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE | ||
: originalDate.getTimezoneOffset(); | ||
: (originalDate?.getTimezoneOffset() ?? 0); | ||
if (Number.isNaN(timeZoneOffset)) { | ||
@@ -88,0 +88,0 @@ throw new RangeError('Invalid time zone specified: ' + timeZone); |
{ | ||
"name": "date-fns-tz", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "Time zone support for date-fns v3 with the Intl API", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
217463
3786
0