Fix for Date and Int datatypes having new editors in MVC4

This commit is contained in:
2012-12-17 21:34:53 -05:00
parent f222cef2e5
commit 2bcca06b7e
12 changed files with 60 additions and 14 deletions
@@ -1,5 +1,13 @@
@model DateTime
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
var inputSize = (string)ViewData.ModelMetadata.AdditionalValues["InputSize"];
}
@if (!string.IsNullOrEmpty(inputSize))
{
@Html.TextBox("", (Model != DateTime.MinValue ? Model.ToShortDateString() : string.Empty ), new { @class = inputSize})
}
else
{
@Html.TextBox("", (Model != DateTime.MinValue ? Model.ToShortDateString() : string.Empty ))
}
@Html.TextBox("", (Model != DateTime.MinValue ? Model.ToShortDateString() : string.Empty ))