use local timezone when calculating dates
All checks were successful
pedestrian-simulator / build (push) Successful in 50s
All checks were successful
pedestrian-simulator / build (push) Successful in 50s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user