From 9c8a2348c89e761a007c618f916813ef81d63d73 Mon Sep 17 00:00:00 2001 From: Wang Date: Thu, 26 Sep 2024 13:05:33 -0700 Subject: [PATCH] TH-121015: fixed the error that dates for inspection updating are still utc format --- Server/SchoolBusAPI/Services/InspectionService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Server/SchoolBusAPI/Services/InspectionService.cs b/Server/SchoolBusAPI/Services/InspectionService.cs index 69b0c3e8b..8be8d334b 100644 --- a/Server/SchoolBusAPI/Services/InspectionService.cs +++ b/Server/SchoolBusAPI/Services/InspectionService.cs @@ -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();