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

moment-timezone-for-local-time

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moment-timezone-for-local-time - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

8

CHANGELOG.md

@@ -0,1 +1,9 @@

# 1.0.0
**BREAKING CHANGES:**
The package now use the in-built types of moment-timezone. The type of arguments is narrowed.
- Type of `this` for `forLocaltime` was `any` and is now `typeof moment.tz`.
- Type `extend` now requires a `typeof moment`.
# 0.1.1

@@ -2,0 +10,0 @@

31

dist/index.d.ts

@@ -0,1 +1,22 @@

import moment from "moment-timezone";
declare module "moment" {
namespace tz {
/**
* List all timezones with the same local time as current system.
*
* @returns list of timezone identifiers
* @author [moment-timezone-for-local-time](https://github.com/Serrulien/moment-timezone-for-local-time)
*/
function forLocalTime(): string[];
/**
* List all timezones with the same local time for a given timestamp.
*
* @param timestamp defaults to Date.now()
* @returns list of timezone identifiers
* @throws {RangeError} when hour isn't in [0, 23] or minute isn't in [0, 59]
* @author [moment-timezone-for-local-time](https://github.com/Serrulien/moment-timezone-for-local-time)
*/
function forLocalTime(hour: number, minute: number, timestamp?: moment.Moment | Date | number | null): string[];
}
}
/**

@@ -7,3 +28,3 @@ * List all timezones with the same local time as current system.

*/
export declare function forLocalTime(this: any): string[];
export declare function forLocalTime(this: typeof moment.tz): string[];
/**

@@ -17,7 +38,3 @@ * List all timezones with the same local time for a given timestamp.

*/
export declare function forLocalTime(this: any, hour: number, minute: number, timestamp?: {
valueOf(): number;
} | Date | number | null): string[];
export declare function extend(momentJS: {
tz: any;
}): void;
export declare function forLocalTime(this: typeof moment.tz, hour: number, minute: number, timestamp?: moment.Moment | Date | number | null): string[];
export declare function extend(momentJS: typeof moment): void;

@@ -1,6 +0,1 @@

/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/**

@@ -17,2 +12,3 @@ * @internal

var zone = zones_1[_i];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var ref = this(timestamp, zone);

@@ -26,3 +22,2 @@ if (ref.hour() === hour && ref.minute() === minute) {

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
function forLocalTime(hour, minute, timestamp) {

@@ -48,3 +43,2 @@ if (arguments.length === 0) {

}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
momentJS.tz.forLocalTime = forLocalTime;

@@ -51,0 +45,0 @@ }

@@ -7,7 +7,2 @@ (function (global, factory) {

/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/**

@@ -24,2 +19,3 @@ * @internal

var zone = zones_1[_i];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var ref = this(timestamp, zone);

@@ -33,3 +29,2 @@ if (ref.hour() === hour && ref.minute() === minute) {

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
function forLocalTime(hour, minute, timestamp) {

@@ -55,3 +50,2 @@ if (arguments.length === 0) {

}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
momentJS.tz.forLocalTime = forLocalTime;

@@ -58,0 +52,0 @@ }

@@ -1,3 +0,1 @@

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { forLocalTime as _forLocalTime } from "./moment-timezone-for-local-time";

@@ -24,5 +22,4 @@ export function forLocalTime(hour, minute, timestamp) {

}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
momentJS.tz.forLocalTime = forLocalTime;
}
//# sourceMappingURL=index.js.map

@@ -1,6 +0,1 @@

/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/**

@@ -17,2 +12,3 @@ * @internal

var zone = zones_1[_i];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var ref = this(timestamp, zone);

@@ -19,0 +15,0 @@ if (ref.hour() === hour && ref.minute() === minute) {

@@ -46,3 +46,3 @@ {

"peerDependencies": {
"moment-timezone": ">=0.2.0"
"moment-timezone": ">=0.5.29"
},

@@ -63,3 +63,3 @@ "repository": {

"types": "dist/index.d.ts",
"version": "0.1.1",
"version": "1.0.0",
"volta": {

@@ -66,0 +66,0 @@ "node": "12.22.0"

@@ -38,6 +38,7 @@ # Moment timezone for local time

| moment-timezone | moment-timezone-for-local-time |
| --------------- | ------------------------------ |
| moment-timezone | moment-timezone-for-local-time | notes |
| --------------- | ------------------------------ | -------------------------------------------------- |
| >= 0.5.29 | 1.0.0 | use at least moment 2.15.0 to avoid type conflicts |
| >= 0.2.0 | 0.1.1 |
| 0.1.0 | 0.1.0 |
| >= 0.2.0 | 0.1.1 |

@@ -44,0 +45,0 @@ ## Setup

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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