use local timezone when calculating dates
All checks were successful
pedestrian-simulator / build (push) Successful in 50s

This commit is contained in:
2026-01-11 18:34:22 -07:00
parent c3532ec051
commit df1ee20994

View File

@@ -143,9 +143,9 @@ func (sm *StepManager) performSync(interval time.Duration) {
totalSteps := 0
today := time.Now().Format("2006-01-02")
// Parse start date
start, _ := time.Parse("2006-01-02", tripStateCopy.StartDate)
end, _ := time.Parse("2006-01-02", today)
// Parse start date in local time
start, _ := time.ParseInLocation("2006-01-02", tripStateCopy.StartDate, time.Local)
end, _ := time.ParseInLocation("2006-01-02", today, time.Local)
// Iterate from Start Date to Today
for d := start; !d.After(end); d = d.AddDate(0, 0, 1) {