2

I'm trying to use Tempus Dominus (for Bootstrap 4) and I can't seem to make it work, when using dynamic data, generated by the Django template.

Right now, Django generates this input block and this is how the browser perceives it.

<div class="input-group date" id="datepickercafe" data-target-input="nearest">
     <input type="text" class="form-control datetimepicker-input" value="2020-05-26" data-target="#datepickercafe">
     <div class="input-group-append" data-target="#datepickercafe" data-toggle="datetimepicker">
         <div class="input-group-text"><i class="fa fa-calendar" aria-hidden="true"></i></div>
     </div>
</div>

My current JS code is taking into consideration the fact that the format is the same as the one I'm trying to populate the input.

$('#datepickercafe').datetimepicker({
     locale: "pt",
     minDate: new Date(),
     format: 'YYYY-MM-DD',
     allowInputToggle: true
});       

The result, right now, is just a clean input. I can't seem to find an option in Tempus Dominus to disable the date formatting either.

How can I fix this problem?

Usama Abdulrehman
  • 1,041
  • 3
  • 11
  • 21

0 Answers0