user5883938 user5883938 - 17 days ago 6
ASP.NET (C#) Question

ASP.NET MVC5 REMOVE DATE FORMAT STRING

enter image description here

Im working with this view , so how can i remove this format dd/mm/yyyy and display nothing on it :

Model

[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "", ApplyFormatInEditMode = false)]
public Nullable<System.DateTime> PatientDOB_ { get; set; }


View

@Html.LabelFor(model => model.PatientDOB_, htmlAttributes: new { @class = "control-label col-md-4" })
@Html.EditorFor(model => model.PatientDOB_, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.PatientDOB_, "", new { @class = "text-danger" })

Answer Source

It looks like you are calling up the HTML5 date picker (which doesn't work on all browsers BTW). I doubt there is a standard way of doing what you want via HTML5. If you use one of the many datepickers from jQuery or bootstrap, you might have more luck.