MattB
2 months ago
322
14
Laravel

Datepicker not accepting config options in laravel

Posted 2 months ago by MattB

So, I have the datepicker references by cdn in the header of my blade thusly:

<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker.min.css" rel="stylesheet"/>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>

and in my app.js file, I have

$('.datepicker').datepicker({
  format: "mm-yyyy",
  startView: "month", 
  minViewMode: "months",
  autoclose: true  
  });

but when I use the following, it doesn't autoclose and it doesn't show just the month and year as it should. What have I potentially done wrong?

<div class="input-group date" data-provide="datepicker" id="datepicker">
                <input type="text" class="form-control">
                <div class="input-group-addon">
                    <span class="glyphicon glyphicon-th"></span>
                </div>
              </div>

Please sign in or create an account to participate in this conversation.