title: How to Subtract Days From Date in TypeScript
body: <p>I would like to subtract days from the current date in TypeScript. 
  For example, if the current date is October 1st, 2017, I would like to subtract 1 day to get September 30th, 2017, or if I want to subtract 3 days I would get September 28th etc.</p>
  
  <p>This is what I have so far, the result is I received December 31st, 1969. Which I assume means that tempDate.getDate() is returning zero, as in the Epoch of January 1, 1970.</p>
  
  <p>This is my code, the goal is to return the previous working day.</p>
  
  <pre><code>    protected generateLastWorkingDay(): Date {
  
          var tempDate = new Date(Date.now());
          var day = tempDate.getDay();
  
  
          //** if Monday, return Friday
          if (day == 1) {
              tempDate = new Date(tempDate.getDate() - 3);
          } else if (1 &lt; day &amp;&amp; day &lt;= 6) {
              tempDate = new Date(tempDate.getDate() - 1);
          }
  
          return tempDate;
      }
  </code></pre>