bootstrap-4datetimepickerbootstrap-datetimepickertempus-dominus-datetimepicker

Inspect the dropdown menu of Bootstrap4 datetimepicker?


I am trying to inspect the elements in the dropdown menu of this datetimepicker. However, whenever I click anywhere the dropdown closes even when forcing the focus state.

I am on a Mac and using Chrome.

Thanks in advance for your help!

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tempus Dominus</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="" />
<meta name="keywords" content="" />

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github.min.css" />
<link rel="stylesheet" href="https://tempusdominus.github.io/bootstrap-4/theme/css/tempusdominus-bootstrap-4.css" />

<style>

</style>

</head>

  <body>
    <script src="https://momentjs.com/downloads/moment.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.0-alpha14/js/tempusdominus-bootstrap-4.min.js"></script>


    <div class="container">
      <div class="row">
        <div class="col-sm-6">
          <input type="text" class="form-control datetimepicker-input" id="datetimepicker5" data-toggle="datetimepicker" data-target="#datetimepicker5" />
        </div>
        <script type="text/javascript">
          $(function() {
            $('#datetimepicker5').datetimepicker();
          });
        </script>
      </div>
    </div>

  </body>
</html>

Solution

  • you need to use the Debug option set to true (to remove before going to production environment). Here an example:

    const _dtpickerOptions = {
        "debug": true
    }
    
    $('#txtDtPicker').datetimepicker("options", _dtpickerOptions);
    

    Hope it helps