mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-19 13:39:26 +00:00
- Massive replacement of changing `code.gitea.io/gitea` to `forgejo.org`. - Resolves forgejo/discussions#258 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7337 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
27 lines
617 B
Go
27 lines
617 B
Go
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
import (
|
|
"time"
|
|
|
|
"forgejo.org/modules/log"
|
|
)
|
|
|
|
// DefaultUILocation is the location on the UI, so that we can display the time on UI.
|
|
var DefaultUILocation = time.Local
|
|
|
|
func loadTimeFrom(rootCfg ConfigProvider) {
|
|
zone := rootCfg.Section("time").Key("DEFAULT_UI_LOCATION").String()
|
|
if zone != "" {
|
|
var err error
|
|
DefaultUILocation, err = time.LoadLocation(zone)
|
|
if err != nil {
|
|
log.Fatal("Load time zone failed: %v", err)
|
|
}
|
|
}
|
|
if DefaultUILocation == nil {
|
|
DefaultUILocation = time.Local
|
|
}
|
|
}
|