From adeaab52c487165235ba42dd73cae6d0c692be31 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 12 Sep 2023 17:49:24 +0500 Subject: [PATCH] WellboreService.GetWellboresAsync(..) fix timezones --- AsbCloudInfrastructure/Services/WellboreService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellboreService.cs b/AsbCloudInfrastructure/Services/WellboreService.cs index 79ef8a3c..5e0e439e 100644 --- a/AsbCloudInfrastructure/Services/WellboreService.cs +++ b/AsbCloudInfrastructure/Services/WellboreService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Threading; @@ -58,8 +59,8 @@ public class WellboreService : IWellboreService Id = group.Key, Name = sections[group.Key].Caption, Well = well.Adapt(), - DateStart = group.Min(operation => operation.DateStart), - DateEnd = group.Max(operation => operation.DateStart.AddHours(operation.DurationHours)), + DateStart = group.Min(operation => operation.DateStart).ToUtcDateTimeOffset(well.Timezone.Hours).ToOffset(TimeSpan.FromHours(well.Timezone.Hours)), + DateEnd = group.Max(operation => operation.DateStart.AddHours(operation.DurationHours)).ToUtcDateTimeOffset(well.Timezone.Hours).ToOffset(TimeSpan.FromHours(well.Timezone.Hours)), DepthStart = group.Min(operation => operation.DepthStart), DepthEnd = group.Max(operation => operation.DepthEnd), });