MySummary
@@ -68,7 +68,7 @@ True
An error occurred.
-
+
True";
diff --git a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/InputTagHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/InputTagHelperTest.cs
index e7718c5214..191fc2d914 100644
--- a/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/InputTagHelperTest.cs
+++ b/test/Microsoft.AspNetCore.Mvc.TagHelpers.Test/InputTagHelperTest.cs
@@ -248,7 +248,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
}
[Theory]
- [InlineData(null, "datetime")]
+ [InlineData("datetime", "datetime")]
+ [InlineData(null, "datetime-local")]
[InlineData("hidden", "hidden")]
public void Process_GeneratesFormattedOutput(string specifiedType, string expectedType)
{
@@ -820,7 +821,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
{ "custom-datatype", null, "text" },
{ "Custom-Datatype", null, "text" },
{ "date", null, "date" }, // No date/time special cases since ModelType is string.
- { "datetime", null, "datetime" },
+ { "datetime", null, "datetime-local" },
{ "datetime-local", null, "datetime-local" },
{ "DATETIME-local", null, "datetime-local" },
{ "Decimal", "{0:0.00}", "text" },
@@ -921,20 +922,88 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
Assert.Equal(expectedTagName, output.TagName);
}
+ [Fact]
+ public async Task ProcessAsync_CallsGenerateTextBox_InputTypeDateTime_RendersAsDateTime()
+ {
+ // Arrange
+ var expectedAttributes = new TagHelperAttributeList
+ {
+ { "type", "datetime" }, // Calculated; not passed to HtmlGenerator.
+ };
+ var expectedTagName = "not-input";
+
+ var context = new TagHelperContext(
+ allAttributes: new TagHelperAttributeList()
+ {
+ {"type", "datetime" }
+ },
+ items: new Dictionary