简体   繁体   English

Bootstrap Datetime选择器不接受选项

[英]Bootstrap Datetime picker not accepting options

On a page that I am working on there is a datetime picker. 我正在处理的页面上有一个日期时间选择器。 It is seemingly working fine, however none of the options seem to be registering and for the life of me I cannot figure out why. 它似乎工作正常,但是似乎没有任何选择可以注册,在我的一生中,我不知道为什么。

I have commented out all javascript, html and external libraries that may be interfering with it. 我已注释掉所有可能会干扰它的javascript,html和外部库。 I have made sure all the files are correct. 我确保所有文件都是正确的。 I have made sure it's being called...anything and everything I can think of. 我确保它被称为...我能想到的任何东西。

Some help would be greatly appreciated. 一些帮助将不胜感激。

<div class="form-group row " >
    <label class="col-md-2 form-control-label" for="StartDate">Start Date</label>
    <div class="controls " >    
        <div class="input-group date col-md-3 datePicker">
             <input type="text" class="form-control required" id="StartDate" name="datePicker">
             <span class="input-group-addon add-on"> <i class="fa fa-calendar" aria-hidden="true"></i> </span> 
        </div>                          
    </div>
</div>

$('.datePicker').datetimepicker({
         format: 'DD/MM/YYYY',//This is not working
         minDate:d.setDate(d.getDate() + 1) //neither is this
     })
     .find("input")
     .end();

This example definitely except format you can test by uncommenting format lines one by one. 此示例绝对是格式,但您可以通过逐行取消注释格式行来进行测试。 I hope this is usable to your request. 希望这对您的要求有用。

  <link rel="stylesheet" href="//code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" type="text/css" media="all" /> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/3.1.4/css/bootstrap-datetimepicker.min.css" type="text/css" media="all" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/3.1.4/js/bootstrap-datetimepicker.min.js"></script> <body> <div class="container"> <div class="input-append date"> <input id="datetimepicker1" data-format="dd/MM/yyyy hh:mm:ss" type="text"></input> </div> </div> </body> <script type="text/javascript"> $(function() { $('#datetimepicker1').datetimepicker({ //format: 'DD/MM/YYYY hh:mm:ss' format: 'DD/MM/YYYY' //format: 'hh:mm:ss' }); }); </script> 

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

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