@using LeafWeb.Web.Utility @model DateTime? @{ DateTime dt; if (Model.HasValue) { dt = (DateTime)Model; } else { dt = DateTime.Now; } }
@Html.LabelFor(m => m, new { @class = "control-label" }) @Html.TextBoxFor(m => m, new { @class="form-control datepicker", data_provide="datepicker", data_date_language="globalize", data_date=dt, data_date_format=System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.Replace("M", "m"), data_date_today_highlight="true", data_date_today_btn="false" }) @Html.ValidationMessageFor(m => m, null, new { @class="help-block" })