TempusDominus Bootstrap4 mix multiple configuration of multiple instances

512 views Asked by At

If I use 2 different instances of TempusDominus Bootstrap4 with different configurations, the result is a mixed UNEXPECTED new configuration for both instances

This is an examples code:

<div class="container">
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
                    <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1"/>
                    <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
                        <div class="input-group-text"><i class="fa fa-calendar"></i></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<label for="Periodo" class="control-label labelFiltro">Periodo</label>

<div class="input-group date" id="Periodo" data-target-input="nearest">
  <input type="text" class="form-control datetimepicker-input" data-target="#Periodo" />
  <div class="input-group-append" data-target="#Periodo" data-toggle="datetimepicker">
    <div class="input-group-text"><i class="fa fa-calendar"></i></div>
  </div>
</div>

 $(function() {
   $('#datetimepicker1').datetimepicker({   useCurrent: false, format: 'MMMM YYYY'});
    $('#Periodo').datetimepicker({ useCurrent: false, format: 'L'});
 });

See this link for fiddle

I expect that first instance shows me a month calendar and second instance shows me a day calendar.

It seems it's a bug...

0

There are 0 answers