Skip to content

Commit

Permalink
fix current Time
Browse files Browse the repository at this point in the history
  • Loading branch information
ringsaturn committed Oct 13, 2021
1 parent 054507a commit 71e5704
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backends/caiyun.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ func (c *CaiyunConfig) Fetch(location string, numdays int) iface.Data {
x := float32(weatherData.Result.Realtime.Visibility)
return &x
}()
res.Current.Time = func() time.Time {
loc, err := time.LoadLocation(weatherData.Timezone)
if err != nil {
panic(err)
}
return time.Now().In(loc)
}()
dailyDataSlice := []iface.Day{}
for i := 0; i < numdays; i++ {
weatherDailyData := weatherData.Result.Daily
Expand Down

0 comments on commit 71e5704

Please sign in to comment.