Skip to content

Commit c24b583

Browse files
committed
Now supported by browsers without Intl
1 parent 616dc97 commit c24b583

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

docs/src/app/components/pages/components/DatePicker/ExampleToggle.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import React from 'react';
22
import DatePicker from 'material-ui/DatePicker';
33
import Toggle from 'material-ui/Toggle';
4+
import areIntlLocalesSupported from 'intl-locales-supported';
45

5-
const DateTimeFormat = global.Intl.DateTimeFormat;
6+
let DateTimeFormat;
7+
8+
if (areIntlLocalesSupported(['en-US'])) {
9+
DateTimeFormat = global.Intl.DateTimeFormat;
10+
} else {
11+
const IntlPolyfill = require('intl');
12+
DateTimeFormat = IntlPolyfill.DateTimeFormat;
13+
require('intl/locale-data/jsonp/en-US');
14+
}
615

716
const optionsStyle = {
817
maxWidth: 255,

0 commit comments

Comments
 (0)