Skip to content

Commit

Permalink
Use DateTimeOffset everywhere instead of string (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed Jul 31, 2024
1 parent 5d268df commit 39b7372
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Octokit.Webhooks/Models/WorkflowJobEvent/WorkflowJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public sealed record WorkflowJob
public string? RunnerGroupName { get; init; }

[JsonPropertyName("started_at")]
public string StartedAt { get; init; } = null!;
[JsonConverter(typeof(DateTimeOffsetConverter))]
public DateTimeOffset StartedAt { get; init; }

[JsonPropertyName("completed_at")]
public string? CompletedAt { get; init; }
Expand All @@ -72,5 +73,6 @@ public sealed record WorkflowJob
public string? HeadBranch { get; init; }

[JsonPropertyName("created_at")]
public string CreatedAt { get; init; } = null!;
[JsonConverter(typeof(DateTimeOffsetConverter))]
public DateTimeOffset CreatedAt { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public sealed record WorkflowJobStep
public long Number { get; init; }

[JsonPropertyName("started_at")]
public string StartedAt { get; init; } = null!;
[JsonConverter(typeof(DateTimeOffsetConverter))]
public DateTimeOffset StartedAt { get; init; }

[JsonPropertyName("completed_at")]
[JsonConverter(typeof(NullableDateTimeOffsetConverter))]
Expand Down

0 comments on commit 39b7372

Please sign in to comment.