@shopify/dates
Advanced tools
Comparing version 0.2.12 to 0.2.13-beta.2.fixchrome80
@@ -8,9 +8,12 @@ "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 | ||
if (options.timeZone != null && options.timeZone === 'Etc/GMT+12') { | ||
var adjustedDate = new Date(date.valueOf() - 12 * 60 * 60 * 1000); | ||
if (options.hour12 != null) { | ||
options.hour12 = undefined; | ||
options.hourCycle = 'h23'; | ||
} | ||
return memoizedGetDateTimeFormat(locales, tslib_1.__assign(tslib_1.__assign({}, options), { timeZone: 'UTC' })).format(adjustedDate); | ||
@@ -17,0 +20,0 @@ } |
{ | ||
"name": "@shopify/dates", | ||
"version": "0.2.12", | ||
"version": "0.2.13-beta.2.fixchrome80", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Lightweight date operations library.", |
Sorry, the diff of this file is not supported yet
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
45178
653