How to format date with Bootstrap-datepicker?
<p>I know how famous is this topic ... but my question is a little bit more complex.
I read documentation <a href="http://bootstrap-datepicker.readthedocs.io/en/latest/options.html#format" rel="nofollow noreferrer">here</a>
I want to display date in french format (dd/mm/yyyy) and save value in US format (yyyy-mm-dd).
I also need to specified startDate which is first day of month.</p>
<p>I tried this configuration :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
  $('#datepicker').datepicker({
    format: {
      language: 'fr',
      toDisplay: function(date, format, language) {
        return date.getUTCDate() + "/" + (date.getUTCMonth() + 1) + "/" + date.getUTCFullYear();
      },
      toValue: function(date, format, language) {
        return new Date(date);
      }
    },
    //startDate: function(date) {
    //    return date.getUTCFullYear() + "-" + date.getUTCMonth() + "-01";
    //},
    autoclose: true,
    todayHighlight: true,
  });
});</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker3.css" rel="stylesheet" /&gt;

&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"&gt;&lt;/script&gt;


&lt;link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet" /&gt;
&lt;input type="text" id="datepicker" /&gt;</code></pre>
</div>
</div>
</p>
<p>But :</p>
<ul>
<li>Display Value : not really french format ... 7/9/2016 instead of
07/09/2016</li>
<li>StartDate : doesn't work</li>
</ul>
<p>Anyone could help me please ?</p>