fix times locale

This commit is contained in:
2025-11-29 00:13:51 +03:30
parent 514486bb6c
commit 61e86b1e96
2 changed files with 5 additions and 3 deletions

View File

@@ -270,3 +270,4 @@ public class VoiceCallTestController : ControllerBase

View File

@@ -32,7 +32,7 @@ public sealed class TelemetryService : ITelemetryService
// ذخیره زمان سرور در لحظه ثبت
entity.ServerTimestampUtc = DateTime.Now;
var dt = dto.TimestampUtc;
var dt = dto.TimestampUtc.ToLocalTime();
var py = PersianCalendar.GetYear(dt);
var pm = PersianCalendar.GetMonth(dt);
var pd = PersianCalendar.GetDayOfMonth(dt);
@@ -65,12 +65,13 @@ public sealed class TelemetryService : ITelemetryService
if (filter.StartDateUtc.HasValue)
{
//var start = filter.StartDateUtc.Value.Date.AddDays(1);
query = query.Where(x => x.ServerTimestampUtc >= filter.StartDateUtc.Value);
query = query.Where(x => x.ServerTimestampUtc >= filter.StartDateUtc.Value.ToLocalTime());
}
if (filter.EndDateUtc.HasValue)
{
query = query.Where(x => x.ServerTimestampUtc < filter.EndDateUtc.Value);
query = query.Where(x => x.ServerTimestampUtc < filter.EndDateUtc.Value.ToLocalTime());
}
if(filter.Page <= 0) filter.Page = 1;