浏览代码

weather-darksky: Don't output old forecasts

We can get historical forecast data back. For example, querying for
Toronto today (Sunday) gives Saturday. Skip this.
Will Storey 8 年之前
父节点
当前提交
d1bc1cb12d
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      weather-darksky.tcl

+ 3 - 0
weather-darksky.tcl

@@ -274,6 +274,9 @@ proc ::wds::output_forecast {chan geonames darksky} {
 		if {$count == 5} {
 			break
 		}
+		if {[dict get $forecast time] < [clock seconds]} {
+			continue
+		}
 		if {$output != ""} {
 			append output " "
 		}