可以删除默认的12:00时间编辑devexpress

时间:2014-02-26 11:29:23

标签: asp.net-mvc devexpress devexpress-mvc

我在MVC 4工作,我使用devexpress

我使用数据编辑器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>

viewtimeedit来了:

enter image description here

问题: 我希望它附带00:00而不是12:00

1 个答案:

答案 0 :(得分:2)

只需设置您想要的时间:

settings.DateTime = DateTime.Now;

或者如果您想要00:00:

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

DisplayFormatString将是:

settings.Properties.DisplayFormatString = HH:mm";