title: Eonasdan/bootstrap-datetimepicker option on a custom script
body: <p>I need to add some options to my datepicker field, I follow the documentation but I need to work on a custom script and I need some help with javascript.</p>
  
  <p>This is the script that I've </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="form-group  col-md-6"&gt;
    &lt;label for="name"&gt;StartDate&lt;/label&gt;
    &lt;input type="date" class="form-control" name="startdate" placeholder="Start Date" value="04/03/2018"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>$('.form-group input[type=date]').each(function (idx, elt) {
      if (elt.type != 'date' || elt.hasAttribute('data-datepicker')) {
          elt.type = 'text';
          $(elt).datetimepicker($(elt).data('datepicker'));
      }
  });
  </code></pre>
  
  <p>I try to add:</p>
  
  <pre><code>$(elt).datetimepicker({
      locale: 'it',
      format: 'DD/MM/YYYY'
  });
  </code></pre>
  
  <p>to set format and locale but doesn't works.</p>
  
  <p>This is the fiddle:
  <a href="https://jsfiddle.net/iotivedo/qf5eopdr/6/" rel="nofollow noreferrer">https://jsfiddle.net/iotivedo/qf5eopdr/6/</a></p>