@formatjs/intl-datetimeformat
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.3.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-datetimeformat@1.3.0...@formatjs/intl-datetimeformat@1.3.1) (2020-06-26) | ||
### Bug Fixes | ||
* **@formatjs/intl-datetimeformat:** fix polyfill check since dateStyle is not stage-4 yet ([a212b42](https://github.com/formatjs/formatjs/commit/a212b42a4f44f9c2be53de9928cb450c4e14c7ea)) | ||
# [1.3.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-datetimeformat@1.2.2...@formatjs/intl-datetimeformat@1.3.0) (2020-06-26) | ||
@@ -8,0 +19,0 @@ |
@@ -6,10 +6,11 @@ "use strict"; | ||
var to_locale_string_1 = require("./to_locale_string"); | ||
function supportsDateStyle() { | ||
return !!new Intl.DateTimeFormat(undefined, { | ||
dateStyle: 'short', | ||
}).resolvedOptions().dateStyle; | ||
} | ||
// function supportsDateStyle() { | ||
// return !!(new Intl.DateTimeFormat(undefined, { | ||
// dateStyle: 'short', | ||
// } as any).resolvedOptions() as any).dateStyle; | ||
// } | ||
if (!('DateTimeFormat' in Intl) || | ||
!('formatToParts' in Intl.DateTimeFormat.prototype) || | ||
!supportsDateStyle()) { | ||
!('formatToParts' in Intl.DateTimeFormat.prototype) | ||
// !supportsDateStyle() | ||
) { | ||
intl_utils_1.defineProperty(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat }); | ||
@@ -16,0 +17,0 @@ intl_utils_1.defineProperty(Date.prototype, 'toLocaleString', { |
import { DateTimeFormat } from '.'; | ||
import { defineProperty } from '@formatjs/intl-utils'; | ||
import { toLocaleString as _toLocaleString, toLocaleTimeString as _toLocaleTimeString, } from './to_locale_string'; | ||
function supportsDateStyle() { | ||
return !!new Intl.DateTimeFormat(undefined, { | ||
dateStyle: 'short', | ||
}).resolvedOptions().dateStyle; | ||
} | ||
// function supportsDateStyle() { | ||
// return !!(new Intl.DateTimeFormat(undefined, { | ||
// dateStyle: 'short', | ||
// } as any).resolvedOptions() as any).dateStyle; | ||
// } | ||
if (!('DateTimeFormat' in Intl) || | ||
!('formatToParts' in Intl.DateTimeFormat.prototype) || | ||
!supportsDateStyle()) { | ||
!('formatToParts' in Intl.DateTimeFormat.prototype) | ||
// !supportsDateStyle() | ||
) { | ||
defineProperty(Intl, 'DateTimeFormat', { value: DateTimeFormat }); | ||
@@ -13,0 +14,0 @@ defineProperty(Date.prototype, 'toLocaleString', { |
{ | ||
"name": "@formatjs/intl-datetimeformat", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Intl.DateTimeFormat polyfill", | ||
@@ -61,3 +61,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "d068e86f36f10f9f0407b17e3fa904c70208b98a" | ||
"gitHead": "40f38e98ec184a9633c2fb1ba84da5f4711406e4" | ||
} |
@@ -10,12 +10,12 @@ import {DateTimeFormat} from '.'; | ||
function supportsDateStyle() { | ||
return !!(new Intl.DateTimeFormat(undefined, { | ||
dateStyle: 'short', | ||
} as any).resolvedOptions() as any).dateStyle; | ||
} | ||
// function supportsDateStyle() { | ||
// return !!(new Intl.DateTimeFormat(undefined, { | ||
// dateStyle: 'short', | ||
// } as any).resolvedOptions() as any).dateStyle; | ||
// } | ||
if ( | ||
!('DateTimeFormat' in Intl) || | ||
!('formatToParts' in Intl.DateTimeFormat.prototype) || | ||
!supportsDateStyle() | ||
!('formatToParts' in Intl.DateTimeFormat.prototype) | ||
// !supportsDateStyle() | ||
) { | ||
@@ -22,0 +22,0 @@ defineProperty(Intl, 'DateTimeFormat', {value: DateTimeFormat}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
45707460
165288