fix(types): humidity and temperature with from and till date
This commit is contained in:
@ -52,12 +52,12 @@ func GetTemperaturesBetweenTimeRange(from time.Time, till *time.Time, temperatur
|
||||
cachedTemperatures := []*types.Temperature{}
|
||||
for _, temperature := range temperatures {
|
||||
|
||||
if till == nil && temperature.TemperatureDate.After(from) {
|
||||
if temperature.TemperatureFromDate.After(from) && till == nil {
|
||||
cachedTemperatures = append(cachedTemperatures, temperature)
|
||||
continue
|
||||
}
|
||||
|
||||
if temperature.TemperatureDate.After(from) && temperature.TemperatureDate.Before(*till) {
|
||||
if temperature.TemperatureFromDate.After(from) && temperature.TemperatureTillDate.Before(*till) {
|
||||
cachedTemperatures = append(cachedTemperatures, temperature)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user