dongting7352 2018-08-17 17:57
浏览 100

Datetimepicker仅显示选择器函数的某些部分

I'm trying to get the datetimepicker working that can be found here

I installed this package using bower and linked all the stylesheets / js files.

When I visit the page I can only see some parts of the the actual datepicker. Here are some pictures to have a better look: enter image description here enter image description here

My links:

<!-- Scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="{{ asset('js/jquery.min.js') }}" defer></script>
<script src="{{ asset('tether/dist/js/tether.min.js') }}" defer></script>
<script src="{{ asset('js/moment.min.js') }}" defer></script>
<script src="{{ asset('js/app.js') }}" defer></script>
<script src="{{ asset('js/bootstrap-datetimepicker.min.js') }}" defer></script>
<script src="{{ asset('js/bootstrap.min.js') }}" defer></script>

<!-- Styles -->

<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/bootstrap-datetimepicker.min.css') }}" rel="stylesheet">

<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/style.css') }}" rel="stylesheet">

My HTML:

@extends ('layouts.app')

@section ('content')
<div class="row">
        <div class='col-sm-6'>
            <div class="form-group">
                <div class='input-group date' id='datetimepicker1'>
                    <input type='text' class="form-control" />
                    <span class="input-group-addon">
                        <span class="glyphicon glyphicon-calendar"></span>
                    </span>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            $(function () {
                $('#datetimepicker1').datetimepicker();
            });
        </script>
    </div>
@endsection

What am I missing here?

  • 写回答

1条回答 默认 最新

  • doushi1510 2018-08-17 18:03
    关注

    Try specifying the format:

    $('#datetimepicker1').datetimepicker({
        format: 'MM/dd/YYYY'
    });
    

    According to the documentation, the format specified in the options defines what components are shown.

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?