Skip to content
Snippets Groups Projects
Commit 754d62e1 authored by Tucker Gary Siegel's avatar Tucker Gary Siegel
Browse files

update

parent 76bfc57c
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,8 @@ import (
func ForecastStages(c *fiber.Ctx) error {
ctx := common.DawnCtx{FiberCtx: c}
request := models.BuildStageRequest(ctx)
return c.Status(fiber.StatusOK).JSON(services.CalculateStages(ctx, request))
stages := services.CalculateStages(ctx, request)
return c.Status(fiber.StatusOK).JSON(stages)
}
// ForecastFreezingDates godoc
......
......@@ -109,10 +109,11 @@ func forecast(ctx context.Context, gddReq models.GddRequest, plantdate time.Time
alpha := 1.0
binCount := 5
product := enums.GetProductFromString(gddReq.Product)
start := plantdate.YearDay() - 1
if plantdate.Year()%4 == 0 && plantdate.Year()%100 != 0 || plantdate.Year()%400 == 0 {
start -= 1
}
// start := plantdate.YearDay() - 1
// if plantdate.Year()%4 == 0 && plantdate.Year()%100 != 0 || plantdate.Year()%400 == 0 {
// start -= 1
// }
start := 0
out := map[string]*models.Bins{}
// need to get the match order
......
......@@ -32,7 +32,6 @@ func GetGddValues(ctx context.Context, request models.GddRequest) models.GddResp
pdInt := request.PlantingDate.YearDay() - 1
gdds.MaxTemps = gdds.MaxTemps[pdInt:]
gdds.MinTemps = gdds.MinTemps[pdInt:]
// }
returnGdds := models.GddResponse{
Product: product.Name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment