Align time stamps with Round instead of Truncate

This commit is contained in:
Alexander Zobnin
2021-09-15 16:27:05 +03:00
parent fcef21b0fb
commit 8fa10bb76b

View File

@@ -287,7 +287,7 @@ func findNearestLeft(series TimeSeries, pointIndex int) *TimePoint {
// Gets point timestamp rounded according to provided interval.
func (p *TimePoint) GetTimeFrame(interval time.Duration) time.Time {
return p.Time.Truncate(interval)
return p.Time.Round(interval)
}
func getPointTimeFrame(ts *time.Time, interval time.Duration) *time.Time {