如何使用斑马线日期选择器添加开始日期和时间?

时间:2019-12-08 06:49:12

标签: php laravel

我已经使用zebradate picker来进行我的Web应用程序的开始时间和结束时间预订,但是我遇到了与zebra date picker的问题,我更改了的格式并添加了H:i,但在网页上却没有显示时间,它只显示开始日期,我想增加时间,如果有人帮助我,我真的很合适,我已经发布了下面的代码。

<!-- Bootstrap CSS -->
{{ Html::style("css/bootstrap.min.css") }}
{{ Html::style('css/font-awesome.min.css') }}
{{ Html::style('plugins/bootstrap-select/dist/css/bootstrap-select.css') }}
{{ Html::style('plugins/Zebra_Datepicker/dist/css/bootstrap/zebra_datepicker.css') }}
{{ Html::style('css/style.css') }}

@yield('style')
<title>@yield('title')</title>
</head>
<body>
@include('layouts.navbar')

<div class="container">
@yield('content')
</div>

{{ Html::script('js/jquery.js') }}
{{ Html::script('js/bootstrap.js') }}
{{ Html::script('plugins/bootstrap-select/dist/js/bootstrap-select.js') }}
{{ Html::script('plugins/Zebra_Datepicker/dist/zebra_datepicker.min.js') }}
{{ Html::script('js/script.js') }}

   @yield('script')
   <script>
   $(document).ready(function () {
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    $('#datepicker').Zebra_DatePicker({
                    format: 'Y-m-d H:i'
                });


<div class="form-group {{ $errors->has('start_date') ? 'has-error' : '' }}">
{!! Form::label('start_date','Start Date:') !!}
{!! Form::date('start_date', $booking->start_date ,['class'=>'form-control datepicker']) !!}
<span class="text-danger">{{ $errors->has('start_date') ? $errors->first('start_date') : '' }} 
</span>

<div class="form-group {{ $errors->has('end_date') ? 'has-error' : '' }}">
{!! Form::label('end_date','End Date') !!}
{!! Form::date('end_date', $booking->end_date ,['class'=>'form-control datepicker']) !!}
<span class="text-danger">{{ $errors->has('end_date') ? $errors->first('end_date') : '' }}</span>
</div>

  @extends('layouts.master')

     @section('title')
      Booking
  @endsection

   @section('content')

<div class="row">

    <div class="col-md-6 mt-3">
        <h2><i class="fa fa-calendar-plus-o"></i> Book A Room</h2>
        <hr>

        @include('errors.errors')

        {{ Form::open(['url' => ['booking']]) }}

        @include('bookings._fields')

        {{ Form::submit('Book Room', ['class'=>'btn btn-primary']) }}

        {!!  link_to('/rooms','back',['class'=>'btn btn-success'], $secure = null) !!}

        {{ Form::close() }}

    </div>
</div>

      @endsection

    @section('script')
    <script>
    $('input.datepicker').Zebra_DatePicker({
      format:'Y-m-d H:i'
    });
    </script>
     @endsection

0 个答案:

没有答案