From 6b369ef2915adbe430f5ba3b172b5c22428044a7 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Mon, 7 Mar 2016 23:46:35 -0800 Subject: [PATCH] [Fixes #4102] DefaultHtmlGenerator should attempt to properly format values for `` and `` --- .../Rendering/Html5DateRenderingMode.cs | 12 ++++++------ ...ionWebSite.HtmlGeneration_Home.Order.Encoded.html | 2 +- ...lGenerationWebSite.HtmlGeneration_Home.Order.html | 2 +- .../Internal/DefaultEditorTemplatesTest.cs | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/Html5DateRenderingMode.cs b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/Html5DateRenderingMode.cs index 677550ccc9..60eac82a91 100644 --- a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/Html5DateRenderingMode.cs +++ b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/Html5DateRenderingMode.cs @@ -9,15 +9,15 @@ namespace Microsoft.AspNetCore.Mvc.Rendering /// public enum Html5DateRenderingMode { - /// - /// Render date and time values according to the current culture's ToString behavior. - /// - CurrentCulture = 0, - /// /// Render date and time values as Rfc3339 compliant strings to support HTML5 date and time types of input /// elements. /// - Rfc3339, + Rfc3339 = 0, + + /// + /// Render date and time values according to the current culture's ToString behavior. + /// + CurrentCulture, } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html index cef19f6c7f..722650400f 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.Encoded.html @@ -11,7 +11,7 @@
- +
diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html index 0ef8e279cd..447f44e8fe 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/compiler/resources/HtmlGenerationWebSite.HtmlGeneration_Home.Order.html @@ -11,7 +11,7 @@
- +
diff --git a/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/DefaultEditorTemplatesTest.cs b/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/DefaultEditorTemplatesTest.cs index 1682c5808b..d00679cb0c 100644 --- a/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/DefaultEditorTemplatesTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/Internal/DefaultEditorTemplatesTest.cs @@ -606,10 +606,10 @@ Environment.NewLine; // DateTime-local is not special-cased unless using Html5DateRenderingMode.Rfc3339. [Theory] - [InlineData("date", "{0:d}", "02/01/2000")] - [InlineData("datetime", null, "02/01/2000 03:04:05 +00:00")] - [InlineData("datetime-local", null, "02/01/2000 03:04:05 +00:00")] - [InlineData("time", "{0:t}", "03:04")] + [InlineData("date", "{0:d}", "2000-01-02")] + [InlineData("datetime", null, "2000-01-02T03:04:05.006+00:00")] + [InlineData("datetime-local", null, "2000-01-02T03:04:05.006")] + [InlineData("time", "{0:t}", "03:04:05.006")] [ReplaceCulture] public void Editor_FindsCorrectDateOrTimeTemplate(string dataTypeName, string editFormatString, string expected) {