Add timezone support to /forecast/hourly endpoint
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user