mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-07-18 16:21:24 +00:00
Fix timezone support for mysql
This commit is contained in:
parent
37bcc85cab
commit
8a48bd4e8b
@ -53,7 +53,11 @@ func setupRenderer(debug bool, registryHost, basePath string) *Template {
|
|||||||
return registry.PrettySize(value)
|
return registry.PrettySize(value)
|
||||||
})
|
})
|
||||||
view.AddGlobal("pretty_time", func(timeVal interface{}) string {
|
view.AddGlobal("pretty_time", func(timeVal interface{}) string {
|
||||||
t, _ := time.Parse("2006-01-02T15:04:05Z", timeVal.(string))
|
t, err := time.Parse("2006-01-02T15:04:05Z", timeVal.(string))
|
||||||
|
if err != nil {
|
||||||
|
// mysql case
|
||||||
|
t, _ = time.Parse("2006-01-02 15:04:05", timeVal.(string))
|
||||||
|
}
|
||||||
return t.In(time.Local).Format("2006-01-02 15:04:05 MST")
|
return t.In(time.Local).Format("2006-01-02 15:04:05 MST")
|
||||||
})
|
})
|
||||||
view.AddGlobal("parse_map", func(m interface{}) string {
|
view.AddGlobal("parse_map", func(m interface{}) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user