3

I'm able to select multiple dates, then save it to database. When reading back from DB, the value attribute of the input field has all previously selected dates in it:

<input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1" value="2019-06-18,2019-06-17,2019-06-19"/>

When the page is loading you can see all 3 briefly listed, but then only 1st one remains and the other 2 disappear.

fiddle

$(function() {
 $('#datetimepicker1').datetimepicker({
    allowMultidate: true,
    multidateSeparator: ',',
    format: 'YYYY-MM-DD'
 });
});
michal
  • 327
  • 4
  • 15

1 Answers1

0

try this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker.css" rel="stylesheet"/>
<input type="text" class="form-control datetimepicker-input" id="datepicker"/>
<script>
    $('#datepicker').datepicker({
  multidate: true
});
</script>
PHP Geek
  • 3,949
  • 1
  • 16
  • 32
  • This works, Thanks. I would like to know what is preventing tempus-dominus to work correctly. – michal Jun 22 '19 at 14:41