Skip to content

Commit

Permalink
chore: prevent time variation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassabreu committed May 25, 2024
1 parent 26ee88d commit 1b8061f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/timehlp/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ func ConvertToTime(timeString string) (t time.Time, err error) {
}

timeString = normalizeFormats(timeString)
t, err = time.ParseInLocation(FullTimeFormat, timeString, time.Local)
if err != nil {
return t, err

Check warning on line 69 in pkg/timehlp/time.go

View check run for this annotation

Codecov / codecov/patch

pkg/timehlp/time.go#L69

Added line #L69 was not covered by tests
}

return time.ParseInLocation(FullTimeFormat, timeString, time.Local)
return t.Truncate(time.Second), nil
}

// Adds data to the partial timeString to match a full
Expand Down

0 comments on commit 1b8061f

Please sign in to comment.