From 86af90f560917c333298c04e742e83073034f1c6 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Wed, 4 Sep 2024 09:30:57 +1000 Subject: [PATCH] =?UTF-8?q?fix(api):=20StatApplication,=20StatHost=20?= =?UTF-8?q?=D0=B1=D0=B5=D1=80=D1=83=D1=82=D1=81=D1=8F=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=B7=D0=BD=D0=B0?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B8=D0=BE=D0=B4=20=D1=81=D0=BE=D0=B3=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=82=D0=B0=D0=B9=D0=BC=D0=B7=D0=BE=D0=BD=D1=8B?= =?UTF-8?q?=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/V1/Statistics/StatApplicationController.cs | 7 +++++-- PARR.API/Controllers/V1/Statistics/StatHostController.cs | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/PARR.API/Controllers/V1/Statistics/StatApplicationController.cs b/PARR.API/Controllers/V1/Statistics/StatApplicationController.cs index a41aa208..e64188de 100644 --- a/PARR.API/Controllers/V1/Statistics/StatApplicationController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatApplicationController.cs @@ -60,8 +60,11 @@ namespace PARR.API.Controllers.V1.Statistics var startPeriod = endPeriod.AddDays(-startPeriodDays); var query = applicationService.Get() - .Where(t => t.DateCreated.DateTime.Date >= startPeriod.Date && t.DateCreated.DateTime.Date <= endPeriod.Date) - .GroupBy(t => t.DateCreated.Date) + .Where(t => + t.DateCreated.DateTime.AddHours(timeZoneQuery.TimeZoneOffsetHours).Date >= startPeriod.Date + && t.DateCreated.DateTime.AddHours(timeZoneQuery.TimeZoneOffsetHours).Date <= endPeriod.Date + ) + .GroupBy(t => t.DateCreated.AddHours(timeZoneQuery.TimeZoneOffsetHours).Date) .Select(t => new { Date = t.Key, diff --git a/PARR.API/Controllers/V1/Statistics/StatHostController.cs b/PARR.API/Controllers/V1/Statistics/StatHostController.cs index 9a548fdb..5133fae9 100644 --- a/PARR.API/Controllers/V1/Statistics/StatHostController.cs +++ b/PARR.API/Controllers/V1/Statistics/StatHostController.cs @@ -60,8 +60,11 @@ namespace PARR.API.Controllers.V1.Statistics var startPeriod = endPeriod.AddDays(-startPeriodDays); var query = hostService.Get() - .Where(t => t.DateCreated.DateTime.Date >= startPeriod.Date && t.DateCreated.DateTime.Date <= endPeriod.Date) - .GroupBy(t => t.DateCreated.Date) + .Where(t => + t.DateCreated.DateTime.AddHours(timeZoneQuery.TimeZoneOffsetHours).Date >= startPeriod.Date + && t.DateCreated.DateTime.AddHours(timeZoneQuery.TimeZoneOffsetHours).Date <= endPeriod.Date + ) + .GroupBy(t => t.DateCreated.AddHours(timeZoneQuery.TimeZoneOffsetHours).Date) .Select(t => new { Date = t.Key,