File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public ActionResult<List<DashboardMetricsByNsiDto>> GetMetricsPerTheme([FromBody
9393 . ThenInclude ( mr => mr . Prompt )
9494 . AsQueryable ( ) ;
9595
96- PeriodeFilter ( factsQuery , filter . StartDate , filter . EndDate ) ;
96+ factsQuery = PeriodeFilter ( factsQuery , filter . StartDate , filter . EndDate ) ;
9797
9898 // Filter out records with exceptions in the model response
9999 factsQuery = factsQuery . Where ( f => f . ParsedModelResponse . ModelResponse . Exception == null ) ;
@@ -154,16 +154,18 @@ private IQueryable<FactCheckResult> PeriodeFilter(IQueryable<FactCheckResult> fa
154154 {
155155 if ( startDate . HasValue )
156156 {
157+ var startUtc = DateTime . SpecifyKind ( startDate . Value , DateTimeKind . Utc ) ;
158+
157159 factCheckResults = factCheckResults . Where ( f =>
158- f . ParsedModelResponse . ModelResponse . CreatedUtc >= startDate . Value ) ;
160+ f . ParsedModelResponse . ModelResponse . CreatedUtc >= startUtc ) ;
159161 }
160162
161163 if ( endDate . HasValue )
162164 {
163- var endDateExclusive = endDate . Value . Date . AddDays ( 1 ) ;
165+ var endUtc = DateTime . SpecifyKind ( endDate . Value . Date . AddDays ( 1 ) , DateTimeKind . Utc ) ;
164166
165167 factCheckResults = factCheckResults . Where ( f =>
166- f . ParsedModelResponse . ModelResponse . CreatedUtc < endDateExclusive ) ;
168+ f . ParsedModelResponse . ModelResponse . CreatedUtc < endUtc ) ;
167169 }
168170
169171 return factCheckResults ;
You can’t perform that action at this time.
0 commit comments