Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

date-fns-tz

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-fns-tz - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

4

dist/cjs/format/formatters/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc