I have this code:
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd/mm/yyyy}")]
public DateTime EstimatedResolveDate { get; set; }
Its in ViewModel. When the ViewModel is displayed on the page, I would like for the time portion to be hidden. Problem is the code doesn't do this and Im not sure why?
@Html.DisplayFor(x => x.EstimatedResolveDate)in your view?@Html.DisplayFor(m => item.EstimatedResolveDate)or@Html.DisplayFor(m => (DateTime)ViewBag.EstimatedResolveDate)