Skip to content

Commit

Permalink
TH-121015: fixed the error that dates for inspection updating are sti…
Browse files Browse the repository at this point in the history
…ll utc format
  • Loading branch information
bcgov-brwang committed Sep 26, 2024
1 parent f11b29a commit 9c8a234
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Server/SchoolBusAPI/Services/InspectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ public virtual IActionResult InspectionsIdPutAsync(int id, Inspection item)
var exists = _context.Inspections.Any(a => a.Id == id);
if (exists && id == item.Id)
{
item.CreatedDate = DateTime.SpecifyKind(item.CreatedDate, DateTimeKind.Unspecified);
item.InspectionDate = DateTime.SpecifyKind(item.InspectionDate, DateTimeKind.Unspecified);
item.PreviousNextInspectionDate = DateTime.SpecifyKind(item.PreviousNextInspectionDate.GetValueOrDefault(), DateTimeKind.Unspecified);
_context.Inspections.Update(item);
// Save the changes
_context.SaveChanges();
Expand Down

0 comments on commit 9c8a234

Please sign in to comment.