Смена формата даты в DrillTestReportDataDto

This commit is contained in:
Olga Nemt 2024-03-21 10:54:41 +05:00
parent 25138ec3ff
commit 62e30b0e8b
3 changed files with 3 additions and 3 deletions

View File

@ -21,6 +21,6 @@ namespace AsbCloudApp.Data.DrillTestReport
/// <summary> /// <summary>
/// Дата отчета /// Дата отчета
/// </summary> /// </summary>
public DateTime Date { get; set; } = DateTime.Now; public DateTimeOffset Date { get; set; } = DateTimeOffset.Now;
} }
} }

View File

@ -49,7 +49,7 @@ namespace AsbCloudInfrastructure.Services.DrillTestReport
well.Deposit ?? "-", well.Deposit ?? "-",
well.Cluster ?? "-", well.Cluster ?? "-",
well.Caption ?? "-"), well.Caption ?? "-"),
Date = DateTime.Now, Date = DateTimeOffset.Now,
}; };
var fileName = string.Format("Drill_test_{0}.xlsx", dto.TimeStampStart.ToString("dd.mm.yyyy_HH_MM_ss")); var fileName = string.Format("Drill_test_{0}.xlsx", dto.TimeStampStart.ToString("dd.mm.yyyy_HH_MM_ss"));

View File

@ -17,7 +17,7 @@ public static class XLExtentions
public static IXLCell SetCellValue<T>(this IXLCell cell, T value, string? format = null) public static IXLCell SetCellValue<T>(this IXLCell cell, T value, string? format = null)
{ {
if (typeof(T) == typeof(DateTime)) if (typeof(T) == typeof(DateTime) || typeof(T) == typeof(DateTimeOffset))
{ {
cell.Style.DateFormat.Format = format ?? "DD.MM.YYYY HH:MM:SS"; cell.Style.DateFormat.Format = format ?? "DD.MM.YYYY HH:MM:SS";
} }