Address TODO item with new `HasNonDefaultEditFormat`
- avoid overriding a datetime format if format was already customized - primarily affects the default Date and Time editor templates because they are often used due to `[DataType]` attributes with "default" edit formats
This commit is contained in:
parent
98e23075dd
commit
dfcd5fe9a9
|
|
@ -355,9 +355,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
|||
|
||||
var metadata = html.ViewData.ModelMetadata;
|
||||
var value = metadata.Model;
|
||||
|
||||
// TODO: add ModelMetadata.HasNonDefaultEditFormat and use here (also return if true)
|
||||
if (html.ViewData.TemplateInfo.FormattedModelValue != value)
|
||||
if (html.ViewData.TemplateInfo.FormattedModelValue != value && metadata.HasNonDefaultEditFormat)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue