Add timezone support to /forecast/hourly endpoint
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-26 20:06:17 -05:00
parent 6806de3c0a
commit b3ac19a65d
7 changed files with 457 additions and 17 deletions

View File

@@ -47,6 +47,21 @@ func copyTimePtr(v *time.Time) *time.Time {
return &out
}
func inLocationTime(v time.Time, loc *time.Location) time.Time {
if loc == nil {
return v
}
return v.In(loc)
}
func inLocationTimePtr(v *time.Time, loc *time.Location) *time.Time {
if v == nil {
return nil
}
out := inLocationTime(*v, loc)
return &out
}
func boolText(v *bool) string {
if v == nil {
return ""