首页 > 解决方案 > MVC 在视图中更改日期类型

问题描述

我想将该日期类型更改为月/年。我该怎么做 ?

日期格式图片

public Nullable<System.DateTime> Month { get; set; }

<div class="form-group">
     @Html.LabelFor(m => m.Month, new { @class = "control-label col-sm-3" })
     <div class="col-sm-9 input-group date">
         @Html.EditorFor(model => model.Month, new { htmlAttributes = new { @class = "form-control input-circle " } })
         @Html.ValidationMessageFor(model => model.Month, "", new { @class = "text-danger " })
     </div>
 </div>

标签: htmlasp.net-mvcdate

解决方案


推荐阅读