title: Bootstrap DatePicker subtract days
body: <p>Below is my snippet code. I want to set the default value of my calendar from date today subtracted to 7 days. Below code is not working since its sets the current date, See my screenshot.</p>
  
  <pre><code>$( "datepast" ).datepicker
      (
          {
              rtl: Metronic.isRTL(),
              language: 'neo',
              orientation: "center",
              autoclose: true,
              date: $( gSelector + "_past_val" ).val(),
              beforeShowDay: function( dt ) { return dt &lt;= new Date(); }
          }
      )
      .datepicker("setDate", "-7") );
  </code></pre>
  
  <p><strong>Output of above code:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Y6HTp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y6HTp.png" alt="enter image description here"></a></p>