简体   繁体   English

Smalot日期选择器/时间选择器

[英]Smalot datepicker/timepicker

I'm using the Smalot/bootstrap-datetimepicker as a time picker, using the options as follows: 我使用Smalot / bootstrap-datetimepicker作为时间选择器,使用以下选项:

$('#timepicker').datetimepicker({
    format: 'hh:ii',
    autoclose: 1,
    startView: 1,
    viewSelect: 4
});

This works as expected, with the target control value set to the selected time. 将目标控制值设置为所选时间,这可以按预期工作。 However the datetimepicker still displays the long date at the top of the selector (27 February 2015 bit): 但是,datetimepicker仍在选择器顶部(2015年2月27日位)显示长日期: TimePicker

How can I get rid of this? 我该如何摆脱呢?

Looking at the JavaScript it is contained in the thead of the table contained in the divs with classes datetimepicker-minutes and datetimepicker-hours . 看一下JavaScript,它包含在divs表的thead中,其类为datetimepicker-minutesdatetimepicker-hours I can't find a straightforward way of hiding the thead element without screwing up the rest of the form (I've tried thead/tr/td class=hidden, height:0). 我找不到不破坏表格其余部分的简单方法来隐藏thead元素(我尝试过thead / tr / td class = hidden,height:0)。

Is there a way of hiding the content inside the thead without affecting the rest of the form? 有没有一种方法可以在不影响表单其余部分的情况下将内容隐藏在thead中?

https://github.com/smalot/bootstrap-datetimepicker/pull/346 https://github.com/smalot/bootstrap-datetimepicker/pull/346

It turns out that there is a branch with support for date-only and time-only selectors. 原来,有一个分支支持仅日期和仅时间选择器。

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

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