Question

I'm working in MVC 4 and i use devexpress.

I use a Data Editor TimeEdit:

<td>
   @Html.DevExpress().TimeEdit(
   settings => {
     settings.ControlStyle.CssClass = "form-control input-sm";
     settings.Name = "HoraInicioFiltro";
     settings.Properties.DisplayFormatString = "h:mm tt";
     settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
   }).GetHtml()
</td>

And in view this timeedit comes:

enter image description here

Problem: I want it comes with 00:00 and not with 12:00

Was it helpful?

Solution

Just set the time that you want:

settings.DateTime = DateTime.Now;

Or if you'd like to have 00:00:

settings.DateTime = new DateTime(2014, 1, 1, 0, 0, 0)

DisplayFormatString for you would be:

settings.Properties.DisplayFormatString = HH:mm";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top