From 3c97563ad5307f5bd3212f8210e52b676cc6a112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Przyw=C3=B3ski?= Date: Tue, 27 Aug 2024 22:13:04 +0200 Subject: [PATCH] Improved formatting in HtmlParsingService --- ExportViewer.Core/Services/HtmlParsingService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ExportViewer.Core/Services/HtmlParsingService.cs b/ExportViewer.Core/Services/HtmlParsingService.cs index 1a45db2..9df8812 100644 --- a/ExportViewer.Core/Services/HtmlParsingService.cs +++ b/ExportViewer.Core/Services/HtmlParsingService.cs @@ -60,6 +60,7 @@ public async Task> GetMessages (string filePath , CultureIn locale.DateTimeFormat.PMDesignator = "po południu"; locale.DateTimeFormat.AMDesignator = "rano"; } + bool isValidDate = DateTime.TryParse(dateElement.TextContent , out var parsedDate); if (!isValidDate) { @@ -96,6 +97,7 @@ public async Task> GetMessages (string filePath , CultureIn locale.DateTimeFormat.PMDesignator = "po południu"; locale.DateTimeFormat.AMDesignator = "rano"; } + bool isValidDate = DateTime.TryParse(dateElement.TextContent , out var parsedDate); if (!isValidDate) { @@ -111,6 +113,7 @@ public async Task> GetMessages (string filePath , CultureIn } }); } + return messages; } }