timezone-js-ts
Advanced tools
Comparing version 1.1.26 to 1.1.27
@@ -1,2 +0,2 @@ | ||
export declare function getCurrentTime(timezone: string, locale?: string): string; | ||
export declare function getCurrentTime(timezone: string, localeIdentifier?: 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, locale) { | ||
function getCurrentTime(timezone, localeIdentifier) { | ||
const date = new Date(); | ||
@@ -47,3 +47,3 @@ const configOptions = { | ||
}; | ||
return new Intl.DateTimeFormat(locale ? locale : 'en-GB', configOptions).format(date); | ||
return new Intl.DateTimeFormat(localeIdentifier ? localeIdentifier : 'en-GB', configOptions).format(date); | ||
} | ||
@@ -50,0 +50,0 @@ function getAllZones() { |
@@ -10,3 +10,3 @@ const fs = require('fs'); | ||
function getCurrentTime(timezone, locale = 'en-GB') { | ||
function getCurrentTime(timezone, localeIdentifier = 'en-GB') { | ||
const date = new Date(); | ||
@@ -18,3 +18,3 @@ const configOptions = { | ||
}; | ||
return new Intl.DateTimeFormat(locale, configOptions).format(date); | ||
return new Intl.DateTimeFormat(localeIdentifier, configOptions).format(date); | ||
} | ||
@@ -21,0 +21,0 @@ |
{ | ||
"name": "timezone-js-ts", | ||
"version": "1.1.26", | ||
"version": "1.1.27", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
import * as zoneData from './all_timezone_lists.json'; | ||
export function getCurrentTime(timezone: string, locale?: string) { | ||
export function getCurrentTime(timezone: string, localeIdentifier?: string) { | ||
const date = new Date(); | ||
@@ -11,3 +11,3 @@ const configOptions: any = { | ||
}; | ||
return new Intl.DateTimeFormat(locale ? locale : 'en-GB', configOptions).format(date); | ||
return new Intl.DateTimeFormat(localeIdentifier ? localeIdentifier : 'en-GB', configOptions).format(date); | ||
} | ||
@@ -14,0 +14,0 @@ |
87982