Can we apply somehow the format for this?
[Display(Name = "Date of Birthday")]
[DataType(DataType.Date)]
public DateTime DOB { get; set; }
I'd like to see only Date and not Time.
Thank you!
You can use the DisplayFormatAttribute
Specifies how data fields are displayed and formatted by ASP.NET Dynamic Data.
http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayformatattribute.aspx
[DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]
[Display(Name = "Date of Birthday")]
[DataType(DataType.Date)]
public DateTime DOB { get; set; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With