简体   繁体   English

ASP.NET MVC和jQuery DateTimePicker:无法显示

[英]ASP.NET MVC and jQuery DateTimePicker : can't display it

I'm using ASP.NET MVC and in one of my views, I have to implement two DateTime fields which could be filled with a DateTimePicker. 我正在使用ASP.NET MVC,在我的一种视图中,我必须实现两个DateTime字段,这些字段可以用DateTimePicker填充。 Here are my fields : 这是我的领域:

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

And the second one : 第二个:

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

As you can see, I gave them an id to say that I want these fields as DateTimePicker. 如您所见,我给他们提供了一个ID,表示我希望这些字段为DateTimePicker。 Here is what I'm doing in my script : 这是我在脚本中正在做的事情:

<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>

The problem is that I only have a DatePicker and not a DateTimePicker and I clearly can't understand why. 问题是我只有一个DatePicker,而没有DateTimePicker,我显然不明白为什么。 Here are the scripts I'm including : 这是我包含的脚本:

<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>

Any idea guys? 有想法吗?

DateTimePicker is not a standard JQueryUI functionallity DateTimePicker不是标准的JQueryUI功能
you will have to use a plugin like http://plugins.jquery.com/datetimepicker/ 您将必须使用http://plugins.jquery.com/datetimepicker/这样的插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM