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

timezone-js-ts

Package Overview
Dependencies
Maintainers
0
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-js-ts - npm Package Compare versions

Comparing version 1.1.24 to 1.1.25

2

dist/index.d.ts

@@ -1,2 +0,2 @@

export declare function getCurrentTime(timezone: string): string;
export declare function getCurrentTime(timezone: string, locale?: string): string;
export declare function getAllZones(): {

@@ -3,0 +3,0 @@ id: number;

@@ -39,3 +39,3 @@ "use strict";

const zoneData = __importStar(require("./all_timezone_lists.json"));
function getCurrentTime(timezone) {
function getCurrentTime(timezone, locale) {
const date = new Date();

@@ -47,3 +47,3 @@ const configOptions = {

};
return new Intl.DateTimeFormat('en-GB', configOptions).format(date);
return new Intl.DateTimeFormat(locale ? locale : 'en-GB', configOptions).format(date);
}

@@ -50,0 +50,0 @@ function getAllZones() {

{
"name": "timezone-js-ts",
"version": "1.1.24",
"version": "1.1.25",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

import * as zoneData from './all_timezone_lists.json';
export function getCurrentTime(timezone: string) {
export function getCurrentTime(timezone: string, locale?: string) {
const date = new Date();

@@ -11,3 +11,3 @@ const configOptions: any = {

};
return new Intl.DateTimeFormat('en-GB', configOptions).format(date);
return new Intl.DateTimeFormat(locale ? locale : 'en-GB', configOptions).format(date);
}

@@ -14,0 +14,0 @@

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