fix: align report date defaults with recent periods
This commit is contained in:
@@ -89,11 +89,7 @@ func (uc *ServerAnalysisUsecase) List(ctx context.Context, f ServerAnalysisFilte
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if f.StartDate == nil || f.EndDate == nil {
|
||||
now := uc.now().In(portraitLocation)
|
||||
day := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, portraitLocation)
|
||||
f.StartDate, f.EndDate = &day, &day
|
||||
}
|
||||
f.StartDate, f.EndDate = reportDateDefaults(f.StartDate, f.EndDate, 30, uc.now())
|
||||
if f.EndDate.Before(*f.StartDate) {
|
||||
return nil, ErrAnalyticsDateOrder
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user