@shopify/dates
Advanced tools
Comparing version 0.1.22 to 0.1.23-fixchrome80
@@ -1,1 +0,5 @@ | ||
export declare function formatDate(date: Date, locales: string | string[], options?: Intl.DateTimeFormatOptions): string; | ||
interface FormatDateOptions extends Intl.DateTimeFormatOptions { | ||
hourCycle?: string; | ||
} | ||
export declare function formatDate(date: Date, locales: string | string[], options?: FormatDateOptions): string; | ||
export {}; |
@@ -8,2 +8,9 @@ "use strict"; | ||
if (options === void 0) { options = {}; } | ||
var formatOptions = Intl.DateTimeFormat(locales, { | ||
hour: 'numeric', | ||
}).resolvedOptions(); | ||
if (options.hour12 != null && formatOptions.hourCycle != null) { | ||
options.hour12 = undefined; | ||
options.hourCycle = 'h23'; | ||
} | ||
// Etc/GMT+12 is not supported in most browsers and there is no equivalent fallback | ||
@@ -10,0 +17,0 @@ if (options.timeZone != null && options.timeZone === 'Etc/GMT+12') { |
{ | ||
"name": "@shopify/dates", | ||
"version": "0.1.22", | ||
"version": "0.1.23-fixchrome80", | ||
"license": "MIT", | ||
@@ -9,4 +9,3 @@ "description": "Lightweight date operations library.", | ||
"scripts": { | ||
"build": "tsc --p tsconfig.build.json", | ||
"prepublishOnly": "yarn run build" | ||
"build": "tsc --p tsconfig.build.json" | ||
}, | ||
@@ -31,3 +30,3 @@ "publishConfig": { | ||
"devDependencies": { | ||
"@shopify/jest-dom-mocks": "^2.7.0", | ||
"@shopify/jest-dom-mocks": "^2.7.1", | ||
"typescript": "~3.2.1" | ||
@@ -34,0 +33,0 @@ }, |
31467
572