Skip to content

Commit

Permalink
Set timeZone default to null
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyyap committed Mar 12, 2017
1 parent 835b5af commit 69db1fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/provider.js
Expand Up @@ -23,6 +23,7 @@ const intlFormatPropNames = Object.keys(intlFormatPropTypes);
const defaultProps = {
formats : {},
messages: {},
timeZone: null,
textComponent: 'span',

defaultLocale : 'en',
Expand Down
6 changes: 3 additions & 3 deletions test/unit/components/provider.js
Expand Up @@ -153,15 +153,14 @@ describe('<IntlProvider>', () => {
const {intl} = renderer.getMountedInstance().getChildContext();

INTL_SHAPE_PROP_NAMES.forEach((propName) => {
if(propName !== 'timeZone') {
expect(intl[propName]).toExist(`Missing context.intl prop: ${propName}`);
}
expect(intl[propName]).toNotBe(undefined, `Missing context.intl prop: ${propName}`);
});
});

it('provides `context.intl` with values from intl config props', () => {
const props = {
locale : 'fr-FR',
timeZone : 'UTC',
formats : {},
messages : {},
textComponent: 'span',
Expand Down Expand Up @@ -255,6 +254,7 @@ describe('<IntlProvider>', () => {
it('inherits from an <IntlProvider> ancestor', () => {
const props = {
locale : 'en',
timeZone: 'UTC',
formats : {
date: {
'year-only': {
Expand Down

0 comments on commit 69db1fe

Please sign in to comment.