Align time stamps with Round instead of Truncate
This commit is contained in:
@@ -287,7 +287,7 @@ func findNearestLeft(series TimeSeries, pointIndex int) *TimePoint {
|
|||||||
|
|
||||||
// Gets point timestamp rounded according to provided interval.
|
// Gets point timestamp rounded according to provided interval.
|
||||||
func (p *TimePoint) GetTimeFrame(interval time.Duration) time.Time {
|
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 {
|
func getPointTimeFrame(ts *time.Time, interval time.Duration) *time.Time {
|
||||||
|
|||||||
Reference in New Issue
Block a user