diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/channel_loader.jsx | 14 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_security.jsx | 8 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 4 |
3 files changed, 14 insertions, 12 deletions
diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx index 2aa28d5c4..174c8c4e1 100644 --- a/web/react/components/channel_loader.jsx +++ b/web/react/components/channel_loader.jsx @@ -20,31 +20,31 @@ import {intlShape, injectIntl, defineMessages} from 'mm-intl'; const holders = defineMessages({ socketError: { id: 'channel_loader.socketError', - defaultMessage: SocketStore.getDefaultTranslations().socketError + defaultMessage: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.' }, someone: { id: 'channel_loader.someone', - defaultMessage: SocketStore.getDefaultTranslations().someone + defaultMessage: 'Someone' }, posted: { id: 'channel_loader.posted', - defaultMessage: SocketStore.getDefaultTranslations().posted + defaultMessage: 'Posted' }, uploadedImage: { id: 'channel_loader.uploadedImage', - defaultMessage: SocketStore.getDefaultTranslations().uploadedImage + defaultMessage: ' uploaded an image' }, uploadedFile: { id: 'channel_loader.uploadedFile', - defaultMessage: SocketStore.getDefaultTranslations().uploadedFile + defaultMessage: ' uploaded a file' }, something: { id: 'channel_loader.something', - defaultMessage: SocketStore.getDefaultTranslations().something + defaultMessage: ' did something new' }, wrote: { id: 'channel_loader.wrote', - defaultMessage: SocketStore.getDefaultTranslations().wrote + defaultMessage: ' wrote: ' } }); diff --git a/web/react/components/user_settings/user_settings_security.jsx b/web/react/components/user_settings/user_settings_security.jsx index 5693047c2..53d79906f 100644 --- a/web/react/components/user_settings/user_settings_security.jsx +++ b/web/react/components/user_settings/user_settings_security.jsx @@ -11,6 +11,7 @@ import TeamStore from '../../stores/team_store.jsx'; import * as Client from '../../utils/client.jsx'; import * as AsyncClient from '../../utils/async_client.jsx'; +import * as Utils from '../../utils/utils.jsx'; import Constants from '../../utils/constants.jsx'; import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl'; @@ -216,15 +217,12 @@ class SecurityTab extends React.Component { var describe; var d = new Date(this.props.user.last_password_update); - var timeOfDay = ' am'; - if (d.getHours() >= 12) { - timeOfDay = ' pm'; - } const locale = global.window.mm_locale; + const hours12 = !Utils.isMilitaryTime(); describe = formatMessage(holders.lastUpdated, { date: d.toLocaleDateString(locale, {month: 'short', day: '2-digit', year: 'numeric'}), - time: d.toLocaleTimeString(locale, {hours12: true, hour: '2-digit', minute: '2-digit'}) + timeOfDay + time: d.toLocaleTimeString(locale, {hour12: hours12, hour: '2-digit', minute: '2-digit'}) }); updateSectionStatus = function updateSection() { diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index e2a5b9620..7f124149d 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -260,6 +260,10 @@ export function displayTimeFormatted(ticks) { ); } +export function isMilitaryTime() { + return PreferenceStore.getBool(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time'); +} + export function displayDateTime(ticks) { var seconds = Math.floor((Date.now() - ticks) / 1000); |