Skip to content

Commit

Permalink
Address TODO item with new HasNonDefaultEditFormat
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
dougbu committed Aug 20, 2014
1 parent 98e2307 commit dfcd5fe
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,7 @@ private static void ApplyRfc3339DateFormattingIfNeeded(IHtmlHelper html, string

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;
}
Expand Down

0 comments on commit dfcd5fe

Please sign in to comment.