diff --git a/components/automate-ui/src/app/page-components/run-history/run-history.component.ts b/components/automate-ui/src/app/page-components/run-history/run-history.component.ts index c6d161ae574..d2ea87d047f 100644 --- a/components/automate-ui/src/app/page-components/run-history/run-history.component.ts +++ b/components/automate-ui/src/app/page-components/run-history/run-history.component.ts @@ -178,7 +178,11 @@ export class RunHistoryComponent implements OnInit, OnDestroy { // react on events for date elector, pass event to parent component dateSelected(selected: string) { const dateString = HistorySelection.startingTimestamp(selected); - this.nodeHistoryStore.addFilter('startDate', this.formatDate(dateString)); + if (selected === 'Last 24 hours') { + this.nodeHistoryStore.addFilter('startDate', moment.utc(dateString).format()); + } else { + this.nodeHistoryStore.addFilter('startDate', this.formatDate(dateString)); + } } private formatDate(dateString: string): string { diff --git a/components/config-mgmt-service/grpcserver/cfg_mgmt.go b/components/config-mgmt-service/grpcserver/cfg_mgmt.go index 4a035c2a98c..0704faaa099 100644 --- a/components/config-mgmt-service/grpcserver/cfg_mgmt.go +++ b/components/config-mgmt-service/grpcserver/cfg_mgmt.go @@ -270,9 +270,9 @@ func (s *CfgMgmtServer) GetRunsCounts(ctx context.Context, if err != nil { return runsCounts, errors.GrpcErrorFromErr(codes.InvalidArgument, err) } - if !params.ValidateDateRange(request.GetStart(), request.GetEnd()) { - return runsCounts, status.Errorf(codes.InvalidArgument, - "Invalid start/end time. (format: YYYY-MM-DD)") + + if !params.ValidateDateTimeRange(request.GetStart(), request.GetEnd()) && !params.ValidateDateRange(request.GetStart(), request.GetEnd()) { + return runsCounts, status.Errorf(codes.InvalidArgument, "Invalid start/end time. (format: YYYY-MM-DD)") } projectFilters, err := filterByProjects(ctx, map[string][]string{}) diff --git a/components/config-mgmt-service/grpcserver/nodes.go b/components/config-mgmt-service/grpcserver/nodes.go index b64e8f937e0..09b2e18071f 100644 --- a/components/config-mgmt-service/grpcserver/nodes.go +++ b/components/config-mgmt-service/grpcserver/nodes.go @@ -48,7 +48,7 @@ func (s *CfgMgmtServer) GetRuns( page, pageSize := request.GetPagination().GetParameters() // Date Range - if !params.ValidateDateRange(request.GetStart(), request.GetEnd()) { + if !params.ValidateDateTimeRange(request.GetStart(), request.GetEnd()) && !params.ValidateDateRange(request.GetStart(), request.GetEnd()) { return runs, status.Errorf(codes.InvalidArgument, "Invalid start/end time. (format: YYYY-MM-DD)") }