diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index cd0b57fbe..4b9b8e29c 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -2,6 +2,7 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.Linq; @@ -173,7 +174,9 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO { if (auditInfo.JsonDetail.IsNullOrEmpty()) { - auditInfo.JsonDetail = JsonConvert.SerializeObject(OptCommand); + IsoDateTimeConverter timeFormat = new IsoDateTimeConverter(); + timeFormat.DateTimeFormat = "yyyy-MM-dd"; + auditInfo.JsonDetail = JsonConvert.SerializeObject(OptCommand, Newtonsoft.Json.Formatting.Indented, timeFormat); } return auditInfo; diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index f68862ee1..f6312dcb1 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -5,6 +5,7 @@ using IRaCIS.Core.Application.Service.Inspection.Interface; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Panda.DynamicWebApi.Attributes; using System; @@ -443,7 +444,10 @@ namespace IRaCIS.Core.Application.Service.Inspection } } - Data.JsonDetail = JsonConvert.SerializeObject(JsonData); + IsoDateTimeConverter timeFormat = new IsoDateTimeConverter(); + timeFormat.DateTimeFormat = "yyyy-MM-dd"; + Data.JsonDetail = JsonConvert.SerializeObject(JsonData, Newtonsoft.Json.Formatting.Indented, timeFormat); + } catch (Exception) {