ASP.. NET MVC和jQuery DateTimePicker:不能显示它

本文关键字:不能 显示 DateTimePicker jQuery NET MVC ASP | 更新日期: 2023-09-27 18:12:01

我正在使用ASP。在我的一个视图中,我必须实现两个DateTime字段,可以用DateTimePicker填充。以下是我的字段:

@Html.EditorFor(s => s.StartApp, new { @id = "Start_App" })

第二个:

@Html.EditorFor(s => s.EndApp, new { @id = "End_App" })

如你所见,我给了它们一个id来表示我想要这些字段作为DateTimePicker。下面是我在脚本中所做的:

<script type="text/javascript">
$(document).ready(function () {
    $('#Start_App').datetimepicker({
        // Arguments for the date picker
        showOptions: { speed: 'fast' },
        changeMonth: false,
        changeYear: false,
        dateFormat: 'dd/mm/yy',
        gotoCurrent: true,
        // Arguments for the time picker    
        showSecond: true,
        timeFormat: 'hh:mm:ss',
        stepHour: 2,
        stepMinute: 10,
        stepSecond: 10
    });
    $('#End_App').datetimepicker({
        // Arguments for the date picker
        showOptions: { speed: 'fast' },
        changeMonth: false,
        changeYear: false,
        dateFormat: 'dd/mm/yy',
        gotoCurrent: true,
        // Arguments for the time picker    
        showSecond: true,
        timeFormat: 'hh:mm:ss',
        stepHour: 2,
        stepMinute: 10,
        stepSecond: 10
    });
});
</script>

问题是,我只有一个DatePicker,而不是DateTimePicker,我显然无法理解为什么。以下是我包含的脚本:

<script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.custom.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.core.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.datepicker.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/DatePickerReady.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.globalize.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.globalize.min.js")" type="text/javascript"></script>

有什么想法吗?

ASP.. NET MVC和jQuery DateTimePicker:不能显示它

DateTimePicker不是标准的JQueryUI功能
你必须使用像http://plugins.jquery.com/datetimepicker/

这样的插件