From d38304bde47f8beabcad7a1de03999d0333db160 Mon Sep 17 00:00:00 2001 From: bcgov-brwang <87880048+bcgov-brwang@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:56:14 -0800 Subject: [PATCH 1/2] SB-429: converted latsUpdatedTimestamp to time zone unspecified --- Server/SchoolBusAPI/Hangfire/CcwJobService.cs | 4 ++++ Server/SchoolBusAPI/SchoolBusAPI.csproj | 2 +- Server/SchoolBusCommon/VersionInfoExtensions.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Server/SchoolBusAPI/Hangfire/CcwJobService.cs b/Server/SchoolBusAPI/Hangfire/CcwJobService.cs index 5193a9c34..7f6088b4e 100644 --- a/Server/SchoolBusAPI/Hangfire/CcwJobService.cs +++ b/Server/SchoolBusAPI/Hangfire/CcwJobService.cs @@ -160,6 +160,10 @@ public async Task UpdateCCWJob() bus.LicencePlateNumber = cCWData.ICBCLicencePlateNumber; } + // SB-429 + DateTime convertedLastUpdatedTimestamp = DateTime.SpecifyKind(bus.CCWData.LastUpdateTimestamp, DateTimeKind.Unspecified); + bus.CCWData.LastUpdateTimestamp = convertedLastUpdatedTimestamp; + _context.SaveChanges(); Log.Information($"[Hangfire] UpdateCCWJob - Saved bus record with the ID {data.Id}."); } diff --git a/Server/SchoolBusAPI/SchoolBusAPI.csproj b/Server/SchoolBusAPI/SchoolBusAPI.csproj index 7709346c5..18d2d12bf 100644 --- a/Server/SchoolBusAPI/SchoolBusAPI.csproj +++ b/Server/SchoolBusAPI/SchoolBusAPI.csproj @@ -9,7 +9,7 @@ Ministry of Transportation and Infrastructure The API server for the schoolbus inspection application. Copyright© 2017, Province of British Columbia. - 2.0.7 + 2.0.8 diff --git a/Server/SchoolBusCommon/VersionInfoExtensions.cs b/Server/SchoolBusCommon/VersionInfoExtensions.cs index 8d0eb27eb..4cf0d29cd 100644 --- a/Server/SchoolBusCommon/VersionInfoExtensions.cs +++ b/Server/SchoolBusCommon/VersionInfoExtensions.cs @@ -54,7 +54,7 @@ public static ApplicationVersionInfo GetApplicationVersionInfo(this Assembly ass Description = assembly.GetCustomAttribute().Description, FileVersion = assembly.GetCustomAttribute().Version, FileCreationTime = creationTime.ToString("O"), // Use the round trip format as it includes the time zone. - InformationalVersion = assembly.GetCustomAttribute().InformationalVersion, + InformationalVersion = assembly.GetCustomAttribute().InformationalVersion.Split('+')[0], TargetFramework = assembly.GetCustomAttribute().FrameworkName, Title = assembly.GetCustomAttribute().Title, ImageRuntimeVersion = assembly.ImageRuntimeVersion, From a29a056046fc3b815ef54fcf1b52dae2658609e5 Mon Sep 17 00:00:00 2001 From: bcgov-brwang <87880048+bcgov-brwang@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:44:45 -0800 Subject: [PATCH 2/2] SB-429: converted datetime format in ccw notifications service --- Server/SchoolBusAPI/Services/CCWNotificationService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Server/SchoolBusAPI/Services/CCWNotificationService.cs b/Server/SchoolBusAPI/Services/CCWNotificationService.cs index d21cb3aff..49f91a80e 100644 --- a/Server/SchoolBusAPI/Services/CCWNotificationService.cs +++ b/Server/SchoolBusAPI/Services/CCWNotificationService.cs @@ -76,11 +76,15 @@ public List GetNotifications(DateTime dateFrom, DateTi dateFrom = DateUtils.ConvertPacificToUtcTime( new DateTime(dateFrom.Year, dateFrom.Month, dateFrom.Day, 0, 0, 0)); + dateFrom = DateTime.SpecifyKind(dateFrom, DateTimeKind.Unspecified); + + dateTo = DateUtils.ConvertPacificToUtcTime( new DateTime(dateTo.Year, dateTo.Month, dateTo.Day, 0, 0, 0)) .AddDays(1) .AddSeconds(-1); + dateTo = DateTime.SpecifyKind(dateTo, DateTimeKind.Unspecified); var notifications = data.SelectMany(x => x.CCWNotifications) .Include(x => x.CCWNotificationDetails)