UTC bugfix again

This commit is contained in:
2026-03-12 20:52:54 +11:00
parent 5ffb712669
commit e31e350c3f
2 changed files with 6 additions and 0 deletions

View File

@@ -46,6 +46,9 @@ func main() {
log.Fatalf("site timezone load: %v", err)
}
rainDayLoc = loc
log.Printf("site timezone configured: %s", cfg.Site.Timezone)
} else {
log.Printf("site timezone not set; falling back to process local timezone: %s", time.Local)
}
log.Printf("rain day timezone: %s", rainDayLoc)

View File

@@ -107,6 +107,9 @@ func Load(path string) (*Config, error) {
if c.Site.Name == "" {
c.Site.Name = "default"
}
if c.Wunderground.Enabled && c.Site.Timezone == "" {
return nil, errors.New("site timezone is required when wunderground is enabled (used for daily rain boundary)")
}
if c.Site.Timezone != "" {
if _, err := time.LoadLocation(c.Site.Timezone); err != nil {
return nil, fmt.Errorf("invalid site timezone %q: %w", c.Site.Timezone, err)