title: Day.js get current date from this week day or what date is this sunday?
body: <p>Using <a href="https://day.js.org/" rel="nofollow noreferrer">dayjs</a> How do you know what date is friday on this week?. Lest say the current start of the week are 14-09-2020 and the end was 20-09-2020, and friday was 18-09-2020.</p>
  <p>How do I make a function that return the date of the day that I was looking for? What I'd have tried.</p>
  <pre class="lang-js prettyprint-override"><code>// 5 is for friday the default of dayjs().day(), 0 for monday and 6 for saturday.
  function getTheDateonDay(day = 5) {
    const startOfWeek = dayjs().startOf('week') // 13-09-2020
    const getDate = dayjs(startOfWeek).day(day) // invalid
    return getDate
  }
  </code></pre>