From 0e86af1b3f8238bc2d96d0e77c0df9ebb5933e1e Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 11 Sep 2019 17:59:25 +0200 Subject: [PATCH] Fixed default value factory. --- .../EnrichContent/DefaultValueFactory.cs | 2 +- .../Operations/EnrichContent/ContentEnrichmentTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Squidex.Domain.Apps.Core.Operations/EnrichContent/DefaultValueFactory.cs b/src/Squidex.Domain.Apps.Core.Operations/EnrichContent/DefaultValueFactory.cs index d7a7a1f21..5c3379739 100644 --- a/src/Squidex.Domain.Apps.Core.Operations/EnrichContent/DefaultValueFactory.cs +++ b/src/Squidex.Domain.Apps.Core.Operations/EnrichContent/DefaultValueFactory.cs @@ -88,7 +88,7 @@ namespace Squidex.Domain.Apps.Core.EnrichContent if (field.Properties.CalculatedDefaultValue == DateTimeCalculatedDefaultValue.Today) { - return JsonValue.Create(now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)); + return JsonValue.Create($"{now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)}T00:00:00Z"); } return JsonValue.Create(field.Properties.DefaultValue?.ToString()); diff --git a/tests/Squidex.Domain.Apps.Core.Tests/Operations/EnrichContent/ContentEnrichmentTests.cs b/tests/Squidex.Domain.Apps.Core.Tests/Operations/EnrichContent/ContentEnrichmentTests.cs index d062a2f97..f525b284c 100644 --- a/tests/Squidex.Domain.Apps.Core.Tests/Operations/EnrichContent/ContentEnrichmentTests.cs +++ b/tests/Squidex.Domain.Apps.Core.Tests/Operations/EnrichContent/ContentEnrichmentTests.cs @@ -117,7 +117,7 @@ namespace Squidex.Domain.Apps.Core.Operations.EnrichContent Fields.DateTime(1, "1", Partitioning.Invariant, new DateTimeFieldProperties { CalculatedDefaultValue = DateTimeCalculatedDefaultValue.Today }); - Assert.Equal(JsonValue.Create("2017-10-12"), DefaultValueFactory.CreateDefaultValue(field, now)); + Assert.Equal(JsonValue.Create("2017-10-12T00:00:00Z"), DefaultValueFactory.CreateDefaultValue(field, now)); } [Fact]