timezone-js-ts
Advanced tools
Comparing version 1.1.24 to 1.1.25
@@ -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 @@ |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
87110
8
4863