Изменение типа дат для FileMarkDto

This commit is contained in:
Olga Nemt 2024-03-21 11:33:43 +05:00
parent b66ca5a515
commit 593183ec87
4 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ namespace AsbCloudApp.Data
/// Необязательно указывать в запросе на создание.
/// </summary>
[Required]
public DateTime DateCreated { get; set; }
public DateTimeOffset DateCreated { get; set; }
/// <summary>
/// Полезный комментарий

View File

@ -282,7 +282,7 @@ namespace AsbCloudInfrastructure.Repository
dto.FileMarks = entity.FileMarks.Select(m =>
{
var mark = m.Adapt<FileMarkDto>();
mark.DateCreated = m.DateCreated.ToRemoteDateTime(timezoneOffset);
mark.DateCreated = m.DateCreated.ToOffset(TimeSpan.FromHours(timezoneOffset));
return mark;
});
return dto;

View File

@ -489,7 +489,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
part.File.FileMarks = marks.Select(m =>
{
var mark = m.Adapt<FileMarkDto>();
mark.DateCreated = m.DateCreated.ToRemoteDateTime(timezoneOffset);
mark.DateCreated = m.DateCreated.ToOffset(TimeSpan.FromHours(timezoneOffset));
return mark;
});
var hasReject = marks.Any(m => m.IdMarkType == idMarkTypeReject);

View File

@ -11,7 +11,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
{
private const string directionDirectorPositionName = "Руководитель направления по ТСБ";
private readonly DateTime totalDate;
private readonly DateTimeOffset totalDate;
private readonly FileMarkDto? acceptDirectionDirector;
private readonly List<FileMarkDto> acceptsOthers;
private readonly WellDto well;
@ -157,7 +157,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Left);
}
private static string FormatDate(DateTime dateTime)
private static string FormatDate(DateTimeOffset dateTime)
=> $"{dateTime.Day:00}.{dateTime.Month:00}.{dateTime.Year:00}";
}