Skip to content

Commit

Permalink
MM-10338 Disabled time zones on IE11 (mattermost#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmhealey authored and GoldUniform committed May 4, 2018
1 parent 87f1676 commit d5c1d22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
6 changes: 3 additions & 3 deletions components/local_date_time/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

import {connect} from 'react-redux';

import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {getUserTimezone} from 'mattermost-redux/selectors/entities/timezone';
import {getUserCurrentTimezone} from 'mattermost-redux/utils/timezone_utils';
import {getBool} from 'mattermost-redux/selectors/entities/preferences';

import {areTimezonesEnabledAndSupported} from 'selectors/general';

import {Preferences} from 'utils/constants.jsx';

import LocalDateTime from './local_date_time';

function mapStateToProps(state, props) {
const config = getConfig(state);
const currentUserId = getCurrentUserId(state);

let userTimezone;
Expand All @@ -25,7 +25,7 @@ function mapStateToProps(state, props) {
}

return {
enableTimezone: config.ExperimentalTimezone === 'true',
enableTimezone: areTimezonesEnabledAndSupported(state),
useMilitaryTime: getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.USE_MILITARY_TIME, false),
timeZone: getUserCurrentTimezone(userTimezone),
};
Expand Down
5 changes: 3 additions & 2 deletions components/profile_popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@

import {connect} from 'react-redux';

import {areTimezonesEnabledAndSupported} from 'selectors/general';

import ProfilePopover from './profile_popover.jsx';

function mapStateToProps(state, ownProps) {
const config = state.entities.general.config;

const enableWebrtc = config.EnableWebrtc === 'true';
const enableTimezone = config.ExperimentalTimezone === 'true';

return {
...ownProps,
enableWebrtc,
enableTimezone,
enableTimezone: areTimezonesEnabledAndSupported(state),
};
}

Expand Down
15 changes: 15 additions & 0 deletions selectors/general.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {getConfig} from 'mattermost-redux/selectors/entities/general';

import * as UserAgent from 'utils/user_agent';

export function areTimezonesEnabledAndSupported(state) {
if (UserAgent.isInternetExplorer()) {
return false;
}

const config = getConfig(state);
return config.ExperimentalTimezone === 'true';
}

0 comments on commit d5c1d22

Please sign in to comment.