Fix typo.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 28 Jan 2019 22:39:00 +0000 (23:39 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 28 Jan 2019 22:39:00 +0000 (23:39 +0100)
web/seepark_web.py

index fb522ba..57509e4 100644 (file)
@@ -341,11 +341,11 @@ def report(year, month):
             cell = ['{}, {}. {}'.format(DAY_OF_WEEK_DE[d.weekday()], d.day, MONTH_DE[d.month-1])]
             for t in report_times:
                 report_datetime = datetime.datetime.combine(d.date(), t)
-                closed_index = np.argmin(np.abs(x - report_datetime))
-                if abs(x[closed_index] - report_datetime) > datetime.timedelta(hours=1):
+                closest_index = np.argmin(np.abs(x - report_datetime))
+                if abs(x[closest_index] - report_datetime) > datetime.timedelta(hours=1):
                     cell.append('N/A')
                 else:
-                    value = y[closed_index]
+                    value = y[closest_index]
                     cell.append('{:.1f}° C'.format(value))
             cells.append(cell)