简体   繁体   English

jquery timepicker开放日期时间选择器

[英]jquery timepicker opening date time picker

I am using jquery UI datetime picker for selecting date and time. 我正在使用jquery UI日期时间选择器来选择日期和时间。 In a particular requirement I just need to select Time from the input field. 在特定要求中,我只需要从输入字段中选择Time。 So i tried to use the following method. 所以我尝试使用以下方法。

$("#inputtext").timepicker();

where as the html for the inputtext is as follows: inputtext的html如下:

<input class="ui-widget ui-widget-content ui-corner-left ui-corner-right" name="inputtext" id="inputtext">

But this opens up entire jquery date time picker. 但是这会打开整个jquery日期时间选择器。

Can you please let me know how can I disable date picker? 你能告诉我如何禁用日期选择器吗? Thanks in advance. 提前致谢。

Note: I have both jquery and jquery-ui imported. 注意:我同时导入了jquery和jquery-ui。

I see such thing for the first time. 我第一次看到这样的事情。 Datepicker and timepicker are separate controls in my project. Datepicker和timepicker是我项目中的单独控件。 Maybe you're using not default timepicker of jQuery. 也许你使用的不是jQuery的默认时间选择器。 If so, you can try this: 如果是这样,你可以试试这个:

$("#inputtext").timepicker({
    timeOnly: true
});

Reference: http://trentrichardson.com/examples/timepicker/ 参考: http//trentrichardson.com/examples/timepicker/

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

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