You've already forked mattermost-webapp
mirror of
https://github.com/zerotier/mattermost-webapp.git
synced 2026-05-22 16:23:25 -07:00
52d4f9ccbb
* bug fix: when retrieving the timezone to pass to the server during a date flag search (on: before: after:) check user's settings and use their selected timezone if present instead of the browser's timezone * fixed jslint rule errors and unit test * more jslint error fixes
23 lines
629 B
React
23 lines
629 B
React
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {getSupportedTimezones as getTimezones} from 'mattermost-redux/selectors/entities/general';
|
|
import moment from 'moment-timezone';
|
|
|
|
import store from 'stores/redux_store.jsx';
|
|
|
|
export function getSupportedTimezones() {
|
|
return getTimezones(store.getState());
|
|
}
|
|
|
|
export function getBrowserTimezone() {
|
|
return moment.tz.guess();
|
|
}
|
|
|
|
export function getBrowserUtcOffset() {
|
|
return moment().utcOffset();
|
|
}
|
|
|
|
export function getUtcOffsetForTimeZone(timezone) {
|
|
return moment.tz(timezone).utcOffset();
|
|
} |