Add Timezone, Zombie GC. Improved and select theme.
This commit is contained in:
1 parent
ea3eba180b
commit
5a596985e0
26 files changed
+605
-59
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package server
|
||||
|
||||
import "time"
|
||||
|
||||
func (s *Server) getTimezoneName() string {
|
||||
|
||||
tz, err :=
|
||||
s.store.GetConfig(
|
||||
"timezone",
|
||||
)
|
||||
|
||||
if err != nil || tz == "" {
|
||||
return "UTC"
|
||||
}
|
||||
|
||||
_, err = time.LoadLocation(tz)
|
||||
|
||||
if err != nil {
|
||||
return "UTC"
|
||||
}
|
||||
|
||||
return tz
|
||||
}
|
||||
|
||||
func (s *Server) getLocation() *time.Location {
|
||||
|
||||
loc, err :=
|
||||
time.LoadLocation(
|
||||
s.getTimezoneName(),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return time.UTC
|
||||
}
|
||||
|
||||
return loc
|
||||
}
|
||||
Reference in new issue
Block a user