date-fns-tz
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -85,7 +85,7 @@ "use strict"; | ||
}; | ||
function getTimeZoneOffset(timeZone, originalDate = undefined) { | ||
function getTimeZoneOffset(timeZone, originalDate) { | ||
var _a; | ||
const timeZoneOffset = timeZone | ||
? (0, index_js_2.tzParseTimezone)(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE | ||
: ((_a = originalDate === null || originalDate === void 0 ? void 0 : originalDate.getTimezoneOffset()) !== null && _a !== void 0 ? _a : 0); | ||
: (_a = originalDate === null || originalDate === void 0 ? void 0 : originalDate.getTimezoneOffset()) !== null && _a !== void 0 ? _a : 0; | ||
if (Number.isNaN(timeZoneOffset)) { | ||
@@ -92,0 +92,0 @@ throw new RangeError('Invalid time zone specified: ' + timeZone); |
@@ -1,1 +0,1 @@ | ||
export declare const getTimezoneOffset: import("../_lib/convertToFP/index.js").CurriedFn2<string, number | Date, number>; | ||
export declare const getTimezoneOffset: import("../_lib/convertToFP/index.js").CurriedFn2<string, number | Date | undefined, number>; |
@@ -27,2 +27,2 @@ /** | ||
*/ | ||
export declare function getTimezoneOffset(timeZone: string, date: Date | number): number; | ||
export declare function getTimezoneOffset(timeZone: string, date?: Date | number): number; |
@@ -82,6 +82,6 @@ import { tzIntlTimeZoneName } from '../../_lib/tzIntlTimeZoneName/index.js'; | ||
}; | ||
function getTimeZoneOffset(timeZone, originalDate = undefined) { | ||
function getTimeZoneOffset(timeZone, originalDate) { | ||
const timeZoneOffset = timeZone | ||
? tzParseTimezone(timeZone, originalDate, true) / MILLISECONDS_IN_MINUTE | ||
: (originalDate?.getTimezoneOffset() ?? 0); | ||
: originalDate?.getTimezoneOffset() ?? 0; | ||
if (Number.isNaN(timeZoneOffset)) { | ||
@@ -88,0 +88,0 @@ throw new RangeError('Invalid time zone specified: ' + timeZone); |
@@ -1,1 +0,1 @@ | ||
export declare const getTimezoneOffset: import("../_lib/convertToFP/index.js").CurriedFn2<string, number | Date, number>; | ||
export declare const getTimezoneOffset: import("../_lib/convertToFP/index.js").CurriedFn2<string, number | Date | undefined, number>; |
@@ -27,2 +27,2 @@ /** | ||
*/ | ||
export declare function getTimezoneOffset(timeZone: string, date: Date | number): number; | ||
export declare function getTimezoneOffset(timeZone: string, date?: Date | number): number; |
{ | ||
"name": "date-fns-tz", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"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
217549