From 568e36e18405f73221134af6318a0bc65f741c5b Mon Sep 17 00:00:00 2001 From: Tucker Siegel <tgsiegel@terpmail.umd.edu> Date: Thu, 1 Dec 2022 12:31:40 -0500 Subject: [PATCH] fix --- services/forecast_service.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/services/forecast_service.go b/services/forecast_service.go index 0604dc0..d2771ed 100644 --- a/services/forecast_service.go +++ b/services/forecast_service.go @@ -129,11 +129,28 @@ func forecast(ctx common.DawnCtx, gddReq models.GddRequest, plantdate time.Time, // check if the last value is closer than the current. if it is, then the last value is the one to return if dist > lastDist { out[keys[currentMatch]] = &models.Bins{ + // ui is hardcoded to accept 5 Bins: []models.Bin{ { Value: 1, Date: plantdate.AddDate(0, 0, i-1), }, + { + Value: 0, + Date: plantdate.AddDate(0, 0, i-2), + }, + { + Value: 0, + Date: plantdate.AddDate(0, 0, i-3), + }, + { + Value: 0, + Date: plantdate.AddDate(0, 0, i-4), + }, + { + Value: 0, + Date: plantdate.AddDate(0, 0, i-5), + }, }, } currentMatch += 1 -- GitLab