Add update of timezone setting

This commit is contained in:
Magnus Åhall 2024-06-27 10:02:11 +02:00
parent 65c0984348
commit 22f6b6a413
3 changed files with 33 additions and 1 deletions

View file

@ -54,3 +54,9 @@ func (cfg *Configuration) SetTheme(theme string) (err error) {
_, err = service.Db.Conn.Exec(`UPDATE public.configuration SET value=$1 WHERE setting='THEME'`, theme)
return
}
func (cfg *Configuration) SetTimezone(tz string) (err error) {
cfg.Settings["TIMEZONE"] = tz
_, err = service.Db.Conn.Exec(`UPDATE public.configuration SET value=$1 WHERE setting='TIMEZONE'`, tz)
return
}