我已将xdsoft datetimepicker jQuery插件集成到我的MVC应用程序中,但我想设置' datetimepickerEnd'的默认值。到'datetimepickerStart'的价值下面是jQuery函数和我称之为的html标记。谢谢!
<script type="text/javascript">
// XDSoft DateTimePicker
jQuery(function () {
var start = jQuery("#datetimepickerStart").datetimepicker({
// on change set default for datetimepickerEnd
});
var end = jQuery("#datetimepickerEnd").datetimepicker({
// default to whatever datetimepickerStart value
});
});
</script>
<div class="col-md-10">
@Html.EditorFor(model => model.Start_DateTime, new { htmlAttributes = new { @class = "form-control", placeholder = "< Click to open DateTimePicker >", id = "datetimepickerStart" } })
@Html.ValidationMessageFor(model => model.Start_DateTime, "", new { @class = "text-danger" })
</div>
<div class="col-md-10">
@Html.EditorFor(model => model.End_DateTime, new { htmlAttributes = new { @class = "form-control", placeholder = "< Click to open DateTimePicker >", id = "datetimepickerEnd" } })
@Html.ValidationMessageFor(model => model.End_DateTime, "", new { @class = "text-danger" })
@Html.ValidationMessage("EndDateError", new { @class = "text-danger" })
</div>