From d6555c1a8b693af13dc4fe41980f921b0b51f744 Mon Sep 17 00:00:00 2001 From: Wang Date: Thu, 26 Sep 2024 11:21:13 -0700 Subject: [PATCH 1/6] TH-121015: committed the missing part from the last fix for TH-120363 --- Server/SchoolBusAPI/Services/InspectionService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/SchoolBusAPI/Services/InspectionService.cs b/Server/SchoolBusAPI/Services/InspectionService.cs index bd72b77a..f0bfa16b 100644 --- a/Server/SchoolBusAPI/Services/InspectionService.cs +++ b/Server/SchoolBusAPI/Services/InspectionService.cs @@ -269,6 +269,8 @@ public virtual IActionResult InspectionsPostAsync(Inspection item) { // Inspection has a special field, createdDate which is set to now. item.CreatedDate = DateTime.UtcNow; + // TH-120363 + item.CreatedDate = DateTime.SpecifyKind(item.CreatedDate, DateTimeKind.Unspecified); _context.Inspections.Add(item); } _context.SaveChanges(); From 415d5369c29478b59c23c970e814274b3643b1b0 Mon Sep 17 00:00:00 2001 From: Wang Date: Thu, 26 Sep 2024 12:18:21 -0700 Subject: [PATCH 2/6] TH-121015: fixed the error that inspection date is still utc format --- Server/SchoolBusAPI/Services/InspectionService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Server/SchoolBusAPI/Services/InspectionService.cs b/Server/SchoolBusAPI/Services/InspectionService.cs index f0bfa16b..69b0c3e8 100644 --- a/Server/SchoolBusAPI/Services/InspectionService.cs +++ b/Server/SchoolBusAPI/Services/InspectionService.cs @@ -258,6 +258,7 @@ public virtual IActionResult InspectionsPostAsync(Inspection item) } var exists = _context.Inspections.Any(a => a.Id == item.Id); + item.InspectionDate = DateTime.SpecifyKind(item.InspectionDate, DateTimeKind.Unspecified); if (exists) { _context.Inspections.Update(item); From 5f4700938143a7958303f4a82836a5ec949c4e56 Mon Sep 17 00:00:00 2001 From: Wang Date: Thu, 26 Sep 2024 12:38:30 -0700 Subject: [PATCH 3/6] TH-121015: fixed the error that next inspection date for schoolbut is still utc format --- Server/SchoolBusAPI/Services/SchoolBusService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/SchoolBusAPI/Services/SchoolBusService.cs b/Server/SchoolBusAPI/Services/SchoolBusService.cs index 38fc61f5..67582b1d 100644 --- a/Server/SchoolBusAPI/Services/SchoolBusService.cs +++ b/Server/SchoolBusAPI/Services/SchoolBusService.cs @@ -292,6 +292,8 @@ private void AdjustSchoolBus(SchoolBus item) item.CCWData = null; } } + + item.NextInspectionDate = DateTime.SpecifyKind(item.NextInspectionDate.GetValueOrDefault(), DateTimeKind.Unspecified); } } From f11b29afc497b6c976ef37d056f613dd3c50aa68 Mon Sep 17 00:00:00 2001 From: Wang Date: Thu, 26 Sep 2024 12:53:06 -0700 Subject: [PATCH 4/6] TH-121015: fixed the error that permist issued date for schoolbut is still utc format --- Server/SchoolBusAPI/Services/SchoolBusService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Server/SchoolBusAPI/Services/SchoolBusService.cs b/Server/SchoolBusAPI/Services/SchoolBusService.cs index 67582b1d..0d36a004 100644 --- a/Server/SchoolBusAPI/Services/SchoolBusService.cs +++ b/Server/SchoolBusAPI/Services/SchoolBusService.cs @@ -294,6 +294,7 @@ private void AdjustSchoolBus(SchoolBus item) } item.NextInspectionDate = DateTime.SpecifyKind(item.NextInspectionDate.GetValueOrDefault(), DateTimeKind.Unspecified); + item.PermitIssueDate = DateTime.SpecifyKind(item.PermitIssueDate.GetValueOrDefault(), DateTimeKind.Unspecified); } } From 9c8a2348c89e761a007c618f916813ef81d63d73 Mon Sep 17 00:00:00 2001 From: Wang Date: Thu, 26 Sep 2024 13:05:33 -0700 Subject: [PATCH 5/6] 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 69b0c3e8..8be8d334 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(); From 01e5ca081a06c26af699ab6db000d5a934ffa8bd Mon Sep 17 00:00:00 2001 From: Wang Date: Fri, 27 Sep 2024 10:26:00 -0700 Subject: [PATCH 6/6] TH-121015: set permit issued date to unspecified format when printing inspection --- Server/SchoolBusAPI/Services/SchoolBusService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Server/SchoolBusAPI/Services/SchoolBusService.cs b/Server/SchoolBusAPI/Services/SchoolBusService.cs index 0d36a004..76537d40 100644 --- a/Server/SchoolBusAPI/Services/SchoolBusService.cs +++ b/Server/SchoolBusAPI/Services/SchoolBusService.cs @@ -847,6 +847,7 @@ public virtual IActionResult SchoolbusesIdNewpermitPutAsync(int id) item.PermitNumber = permit; item.PermitIssueDate = DateTime.UtcNow; + item.PermitIssueDate = DateTime.SpecifyKind(item.PermitIssueDate.GetValueOrDefault(), DateTimeKind.Unspecified); _context.SchoolBuss.Update(item); _context.SaveChanges();