Skip to content

Commit

Permalink
Merge pull request #87 from Millarex/patch-1
Browse files Browse the repository at this point in the history
Convert DateTime values to Utc kind
  • Loading branch information
mo-esmp authored Sep 1, 2023
2 parents 973aa2b + e722ee9 commit 8bf5d94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Serilog.Ui.PostgreSqlProvider/PostgreDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public PostgresDataProvider(RelationalDbOptions options)
DateTime? endDate = null
)
{
if (startDate != null && startDate.Value.Kind != DateTimeKind.Utc)
startDate = DateTime.SpecifyKind(startDate.Value, DateTimeKind.Utc);
if (endDate != null && endDate.Value.Kind != DateTimeKind.Utc)
endDate = DateTime.SpecifyKind(endDate.Value, DateTimeKind.Utc);
var logsTask = GetLogsAsync(page - 1, count, logLevel, searchCriteria, startDate, endDate);
var logCountTask = CountLogsAsync(logLevel, searchCriteria, startDate, endDate);

Expand Down Expand Up @@ -139,4 +143,4 @@ private void GenerateWhereClause(
}
}
}
}
}

0 comments on commit 8bf5d94

Please sign in to comment.