From c0aefae8806aef931307b5760dcfcc617cc216f0 Mon Sep 17 00:00:00 2001 From: Aune Date: Tue, 5 Jul 2022 14:17:31 +0200 Subject: [PATCH] Fixed cache date matching bug --- route_statistics.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/route_statistics.go b/route_statistics.go index 06c04a3..b4d65a4 100644 --- a/route_statistics.go +++ b/route_statistics.go @@ -256,17 +256,12 @@ func WrapperrDownloadDays(ID int, wrapperr_data []WrapperrDay, loop_interval int var found_date_index int = 0 for j := 0; j < len(wrapperr_data); j++ { - loc, err := time.LoadLocation(config.Timezone) + time_temp, err := time.Parse("2006-01-02", wrapperr_data[j].Date) if err != nil { log.Println(err) } - time_temp, err := time.ParseInLocation("2006-01-02", wrapperr_data[j].Date, loc) - if err != nil { - log.Println(err) - } - - if time_temp.Equal(loop_time) { + if time_temp.Format("2006-01-02") == loop_time.Format("2006-01-02") { found_date_index = j found_date = true break