mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* Moving goroutine pool * Auto refactor * Moving plugins. * Auto refactor * Moving fields to server * Auto refactor * Removing siteurl duplication. * Moving reset of app fields * Auto refactor * Formatting * Moving niling of Server to after last use * Fixing unit tests.
29 lines
775 B
Go
29 lines
775 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
package app
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost-server/model"
|
|
"github.com/mattermost/mattermost-server/utils"
|
|
)
|
|
|
|
func (a *App) Timezones() model.SupportedTimezones {
|
|
if cfg := a.Srv.timezones.Load(); cfg != nil {
|
|
return cfg.(model.SupportedTimezones)
|
|
}
|
|
return model.SupportedTimezones{}
|
|
}
|
|
|
|
func (a *App) LoadTimezones() {
|
|
timezonePath := "timezones.json"
|
|
|
|
if a.Config().TimezoneSettings.SupportedTimezonesPath != nil && len(*a.Config().TimezoneSettings.SupportedTimezonesPath) > 0 {
|
|
timezonePath = *a.Config().TimezoneSettings.SupportedTimezonesPath
|
|
}
|
|
|
|
timezoneCfg := utils.LoadTimezones(timezonePath)
|
|
|
|
a.Srv.timezones.Store(timezoneCfg)
|
|
}
|