Css 易于使用的日期时间选择器

Css 易于使用的日期时间选择器,css,twitter-bootstrap,bootstrap-datetimepicker,Css,Twitter Bootstrap,Bootstrap Datetimepicker,我正在寻找一个易于使用的日期时间选择器。我尝试使用引导日期时间选择器,我使用的是引导4 alpha。这对我不起作用 这是我的密码: <script> $(function() { $('#datetimepicker1').datetimepicker(); }); </script> <script src="https://code.jquery.com/jquery-3.2.1.min.js">&l

我正在寻找一个易于使用的日期时间选择器。我尝试使用引导日期时间选择器,我使用的是引导4 alpha。这对我不起作用

这是我的密码:

    <script>
    $(function() {
        $('#datetimepicker1').datetimepicker();
    });
    </script>
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
   <!-- Moment JS -->
    <script type="text/javascript" src="<?php echo $ROOT; ?>js/moment.min.js"></script>
    <!--Bootstrap JS -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" ></script>
    <!-- dateTimePicker JS -->
    <script type="text/javascript" src="<?php echo $ROOT; ?>js/bootstrap-datetimepicker.min.js"></script>
    <!--bootstrap  -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
    <!-- dateTimePicker CSS -->
    <link rel="stylesheet" type="text/css" href="<?php echo $ROOT; ?>css/bootstrap-datetimepicker.min.css"> 

    <div class = "form-group col col-md-4 col-sm-4 col-12">
        <div class='input-group date' id='datetimepicker1'>
          <input type='text' class="form-control" id="servDate"/>
          <span class="input-group-addon">
            <span class="glyphicon glyphicon-calendar"></span>
          </span>
        </div>
    </div>

$(函数(){
$('#datetimepicker1')。datetimepicker();
});
尝试使用引导3。
找到一些有用的链接:

希望这有帮助。

使用稳定库,可能是您不知道测试版中的bug在哪里;) 试试这个

<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<!-- Moment JS -->
<script type="text/javascript" src="//momentjs.com/downloads/moment.js"></script>
<!--Bootstrap JS -->
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<!-- dateTimePicker JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<!-- bootstrap  -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" />
<!-- dateTimePicker CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script>
$(function() {
    $('#datetimepicker1').datetimepicker();
});
</script>
<div class = "form-group col col-md-4 col-sm-4 col-12">
    <div class='input-group date' id='datetimepicker1'>
        <input type='text' class="form-control" id="servDate"/>
        <span class="input-group-addon">
            <span class="glyphicon glyphicon-calendar"></span>
        </span>
    </div>
</div>

$(函数(){
$('#datetimepicker1')。datetimepicker();
});
可能会有点帮助^ ^

我建议使用:这是DateTimePicker(Eonasdan/Bootstrap DateTimePicker的继承者)的Bootstrap 4版本

您可以在文档中找到示例:

Github回购:

然而,这里有一个来自tempusdominus文档的工作片段(最佳视图扩展片段):

$(函数(){
$('#datetimepicker1')。datetimepicker();
});


这就是我一直在使用的。但是我不能进入Bootstrap3,因为我的页面很大,这将是一个很大的工作。有一些改进。我可以单击日历并显示当前日期时间。但是datetime选择器在bootstrap 3中是完全空白的,如果你碰巧在bootstrap中使用jquery,试试这个:它很容易使用,甚至在页面的中间有一个配置生成器。很好,这很有效,但我不能像你那样在其中获取当前日期。