Javascript 如何从jQuery DateTimePicker、Asp.Net中删除/隐藏时间
我删除了calendar窗口小部件中的时间选择和字段中的开始日期,也没有时间。 但主要问题是,当您选择日期时,当前时间仍会插入该字段中。只需显示日期,不显示时间 cshtmlJavascript 如何从jQuery DateTimePicker、Asp.Net中删除/隐藏时间,javascript,c#,asp.net,time,datetimepicker,Javascript,C#,Asp.net,Time,Datetimepicker,我删除了calendar窗口小部件中的时间选择和字段中的开始日期,也没有时间。 但主要问题是,当您选择日期时,当前时间仍会插入该字段中。只需显示日期,不显示时间 cshtml <div class="form-group"> @Html.LabelFor(model => model.DateTo, htmlAttributes: new { @class = "control-label col-md-2" }) <div cla
<div class="form-group">
@Html.LabelFor(model => model.DateTo, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.DateTo, "{0:d}", new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.DateTo, "", new { @class = "text-danger" })
</div>
模型
jQuery DateTimePicker插件v2.4.5
如果有简单的asp net替代小部件,请提供建议
$("#DateTo").datetimepicker({
timepicker: false,
pickTime: false,
closeOnDateSelect: true,
dateFormat: "yy/mm/dd"
});
[Display(Name = "DateTo", ResourceType = typeof(Resources.Resource))]
[DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}", ApplyFormatInEditMode = true)]
[Required]
public DateTime DateTo { get; set; }