title: Set valid locale for datetimepicker
body: <p>I have quite strange issue. I'm using jQuery 3, Boostrap 3 and this <a href="https://github.com/Eonasdan/bootstrap-datetimepicker" rel="nofollow noreferrer">DateTimepicker</a>. The problem is that in datetime picker at first attempt I'm always getting invalid locale (always English), but on second attempt (and further) it's valid. The end of my website look like this:</p>
  
  <pre><code> &lt;script&gt;
      $.when($.ready).then(function () {
          moment().locale('da');
  
          $('.datetimepicker').datetimepicker({
              locale: 'da',
              viewMode: 'years',
              format: 'YYYY-MM-DD',
              defaultDate: false,
              useCurrent: false,
              viewDate: '1999-04-20'
          });
      })
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've added this <code>moment().locale('da');</code> because I thought it would solve the issue but it doesn't in my case.</p>
  
  <p>Any clue how can I force this to make it work?</p>
  
  <p>If it's important, I'm using WebPack and my JS file looks like this:</p>
  
  <pre><code>window.$ = window.jQuery = require('jquery');
  
  require('bootstrap-sass');
  require('bootstrap-select');
  require('eonasdan-bootstrap-datetimepicker');
  
  var moment = require('moment');
  window.moment = moment;
  </code></pre>
  
  <p>It seems that when I change in this file:</p>
  
  <pre><code>var moment = require('moment');
  window.moment = moment;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>var moment = require('moment');
  moment.locale('da');
  window.moment = moment;
  </code></pre>
  
  <p>Locale is set in valid way at 1st attempt. Unfortunately I have multiple languages and probably it doesn't make much sense to have multiple JS files just to make moment use valid locale.</p>
  
  <p>Is there any way to solve this?</p>