title: Disable Future date in TempusDominus bootstrap4 datetimepicker
body: <p>I am using TempusDominus bootstrap4 datetimepicker in my html view.
  So I Added the below scripts in my project.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script src=&quot;~/js/tempusdominus-bootstrap-4.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;~/js/moment.js&quot;&gt;&lt;/script&gt;
  &lt;link href=&quot;~/css/tempusdominus-bootstrap-4.min.css&quot; rel=&quot;stylesheet&quot; /&gt;
  </code></pre>
  <p>I already have the below scripts in my layout.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script type=&quot;text/javascript&quot; src=&quot;https://code.jquery.com/jquery-1.11.3.min.js&quot;&gt;&lt;/script&gt;
  
  @*scripts for unobtrusive client side validations*@
  &lt;script src=&quot;https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://ajax.aspnetcdn.com/ajax/jquery.validate/1.16.0/jquery.validate.min.js&quot;&gt;&lt;/script&gt;    &lt;scriptsrc=&quot;https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js&quot;&gt;&lt;/script&gt;
  
  
      &lt;script src=&quot;https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/jquery.inputmask.bundle.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.10/jquery.mask.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;~/lib/bootstrap/dist/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>My html view is as below:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;input-group date&quot; id=&quot;datetimepicker4&quot; data-target-input=&quot;nearest&quot;&gt;
          &lt;input type=&quot;text&quot; class=&quot;form-control datetimepicker-input&quot; data-target=&quot;#datetimepicker4&quot;
                 name=&quot;date&quot;
                 id=&quot;datetimepicker4&quot;/&gt;
          &lt;div class=&quot;input-group-append custom-datetimepicker&quot; data-target=&quot;#datetimepicker4&quot; data-toggle=&quot;datetimepicker&quot;&gt;
              &lt;div class=&quot;input-group-text&quot;&gt;&lt;i class=&quot;fa fa-calendar&quot;&gt;&lt;/i&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>My javascript is as follows:</p>
  <pre class="lang-js prettyprint-override"><code> $(function () {
      $('#datetimepicker4').datetimepicker({
          format: 'L',
          useCurrent: false,
          maxDate: new Date()
      });
  });
  </code></pre>
  <p>The same code is working fine in fiddler, but it is not working in my application.</p>
  <p>I am able to disable the future date by <code>option maxDate:new Date()</code> and due to the <code>option useCurrent:false</code> By default the current date is not filling on page load.</p>
  <p>But the issue I am having here is, for the very first time I am unable to select the current date, but for the second time I am able to select it.
  So I am not sure whether the existing bootstrap js files are overwriting my datetime picker options.</p>