Merge pull request #2155 from ZBoxApp/PLT-1948
PLT-1948: Fix duplicate am/pm on last password update
Этот коммит содержится в:
@@ -11,6 +11,7 @@ import TeamStore from '../../stores/team_store.jsx';
|
|||||||
|
|
||||||
import * as Client from '../../utils/client.jsx';
|
import * as Client from '../../utils/client.jsx';
|
||||||
import * as AsyncClient from '../../utils/async_client.jsx';
|
import * as AsyncClient from '../../utils/async_client.jsx';
|
||||||
|
import * as Utils from '../../utils/utils.jsx';
|
||||||
import Constants from '../../utils/constants.jsx';
|
import Constants from '../../utils/constants.jsx';
|
||||||
|
|
||||||
import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl';
|
import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl';
|
||||||
@@ -216,15 +217,12 @@ class SecurityTab extends React.Component {
|
|||||||
|
|
||||||
var describe;
|
var describe;
|
||||||
var d = new Date(this.props.user.last_password_update);
|
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 locale = global.window.mm_locale;
|
||||||
|
const hours12 = !Utils.isMilitaryTime();
|
||||||
describe = formatMessage(holders.lastUpdated, {
|
describe = formatMessage(holders.lastUpdated, {
|
||||||
date: d.toLocaleDateString(locale, {month: 'short', day: '2-digit', year: 'numeric'}),
|
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() {
|
updateSectionStatus = function updateSection() {
|
||||||
|
|||||||
@@ -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) {
|
export function displayDateTime(ticks) {
|
||||||
var seconds = Math.floor((Date.now() - ticks) / 1000);
|
var seconds = Math.floor((Date.now() - ticks) / 1000);
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user