title: Covert dates to get first day or last day in the month
body: <p>I have an object array which contains a start and end date for multiple events. Below is an example of one object in it</p>
  <pre><code>{
  end_date: &quot;2022-07-22T00:00:00.000Z&quot;
  name: &quot;Event 1&quot;
  start_date: &quot;2021-09-08T00:00:00.000Z&quot;
  }
  </code></pre>
  <p>Is there a way to change the start date to the first day in whatever month it is, and the end day to the last day in whatever month it is?</p>
  <p>I tried this:</p>
  <pre><code>dates.start_date.setDate(1);
  dates.end_date.setDate(28);
  </code></pre>
  <p>but it's saying setDate is not a function</p>