fix end date calculation (#11232)

This commit is contained in:
swayne275 2021-03-30 09:58:45 -06:00 committed by GitHub
parent 8898f84a1e
commit 532093d065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ func (b *SystemBackend) handleClientMetricQuery(ctx context.Context, req *logica
// Also convert any user inputs to UTC to avoid
// problems later.
if endTime.IsZero() {
endTime = timeutil.EndOfMonth(time.Now().UTC().AddDate(0, -1, 0))
endTime = timeutil.EndOfMonth(timeutil.StartOfPreviousMonth(time.Now().UTC()))
} else {
endTime = endTime.UTC()
}