我找到了jQuery DataPicker(http://trentrichardson.com/examples/timepicker/#slider_examples)。
但它不适用于@ HTML.EditorFor,为什么?
@*working*@
<input type="text" name="basic_example_1" id="basic_example_1" value="">
@*not working*@
@Html.EditorFor(model => model.eventstart, new { htmlAttributes = new { @class = "basic_example_1" } })
<script>
$('#basic_example_1').datetimepicker($.timepicker.regional['pl']);
</script>
答案 0 :(得分:1)
您尝试通过id(#basic_example_1)访问第二个示例,同时为其提供课程。所以尝试使用:
$('.basic_example_1').datetimepicker($.timepicker.regional['pl']);