Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 8380597

Browse files
Fix note date parsing
1 parent d3c94d7 commit 8380597

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Alidade.Osm/Handlers/Parsing/ParseNotesJson.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Globalization;
12
using System.Text.Json;
23

34
namespace Alidade.Osm.Handlers.Parsing;
@@ -33,10 +34,10 @@ public async Task<QueryResult<IList<OsmNote>>> Handle(Query request, Cancellatio
3334
coords[1].GetDouble(),
3435
coords[0].GetDouble(),
3536
props.GetProperty("status").GetString() ?? "open",
36-
DateTimeOffset.Parse(props.GetProperty("date_created").GetString()!),
37+
DateTimeOffset.ParseExact(props.GetProperty("date_created").GetString()!, "yyyy-MM-dd HH:mm:ss UTC", CultureInfo.InvariantCulture),
3738
[.. props.GetProperty("comments").GetProperty("comments").EnumerateArray()
3839
.Select(c => new OsmNoteComment(c.GetProperty("action").GetString() ?? string.Empty,
39-
DateTimeOffset.Parse(c.GetProperty("date").GetString()!),
40+
DateTimeOffset.ParseExact(c.GetProperty("date").GetString()!, "yyyy-MM-dd HH:mm:ss UTC", CultureInfo.InvariantCulture),
4041
c.TryGetProperty("user", out JsonElement u)
4142
? u.GetString()
4243
: null,

0 commit comments

Comments
 (0)