title: how to render the correct date from table in mysql in react js
body: <p>I'm kinda stuck I have a table with 4 readings in MySQL with different dates in the date field when I go to render them out they all show today's date... why?, what am i doing wrong? here is my code...</p>
  
  <p>getReading = user_id => {
      const { readings } = this.state;</p>
  
  <pre><code>if (
    readings.length &gt; 0 &amp;&amp;
    readings.find(reading =&gt; reading.user_id === user_id)
  ) {
    this.setState({
      reading: {
        ...this.state.reading,
        user_id: readings.find(reading =&gt; reading.user_id === user_id)
          .user_id,
        date: readings.find(reading =&gt; reading.user_id === user_id).date,
        sugarB: readings.find(reading =&gt; reading.user_id === user_id).sugarB,
        carbsB: readings.find(reading =&gt; reading.user_id === user_id).carbsB,
        insulinB: readings.find(reading =&gt; reading.user_id === user_id)
          .insulinB,
        insulinSB: readings.find(reading =&gt; reading.user_id === user_id)
          .insulinSB,
        insulinFB: readings.find(reading =&gt; reading.user_id === user_id)
          .insulinFB,
        sugarL: readings.find(reading =&gt; reading.user_id === user_id).sugarL,
        carbsL: readings.find(reading =&gt; reading.user_id === user_id).carbsL,
        insulinL: readings.find(reading =&gt; reading.user_id === user_id)
          .insulinL,
        hbp: readings.find(reading =&gt; reading.user_id === user_id).hbp,
        lbp: readings.find(reading =&gt; reading.user_id === user_id).lbp,
        hr: readings.find(reading =&gt; reading.user_id === user_id).hr,
        sugarD: readings.find(reading =&gt; reading.user_id === user_id).sugarD,
        carbsD: readings.find(reading =&gt; reading.user_id === user_id).carbsD,
        insulinD: readings.find(reading =&gt; reading.user_id === user_id)
          .insulinD
      }
    });
  }
  </code></pre>
  
  <p>};
  and my state looks like this...
        readings: [],
        reading: {
          user_id: 0,
          date: new Date().toLocaleDateString(),
          sugarB: 0,
          carbsB: 0,
          insulinB: 0,
          insulinSB: 0,
          insulinFB: 0,
          sugarL: 0,
          carbsL: 0,
          insulinL: 0,
          hbp: 0,
          lbp: 0,
          hr: 0,
          sugarD: 0,
          carbsD: 0,
          insulinD: 0
        },</p>