title: How convert date properly in ReactJS frontend side
body: <p>My API return some array of objects with LocalDate string and when I get it in my frontend side I want to convert it from state to JS Date object with timezone.</p>
  
  <p>I tried to do it in componentDidMount() function after fetching API data but after setting state  react developer tool shows me that dateList state is udentified.</p>
  
  <p>DateComponent</p>
  
  <pre><code>class DateComponent extends Component {
      constructor(props) {
          super(props);
  
          this.state = {
              dateList: [],
              id: this.props.id,
  
          }
  
      }
  
      componentDidMount() {
         DateService.retrieveProfile(this.state.id)
              .then(response =&gt; {
                  this.setState({
                      dateList:this.convertDatesToTimezoneUTC(response.data.dateList)
                  })
              })
      }
  
      convertDatesToTimezoneUTC(dateList) {
         dateList.map((value) =&gt; (
                  value.date = new Date(value.date),
              )
          );
      }
  
  
      render() {
          let {dateList, id} = this.state;
  
            return (
              &lt;div&gt;
                &lt;Formik
                 enableReinitialize
                 initialValues={{dateList}}&gt;
                  &lt;FieldArray name="dateList"
                       render={() =&gt; (
                          &lt;div&gt;
                               {dateList.map((value, index) =&gt; (
                                &lt;div className={"m-3 form-row"} id={value.id} key={index}&gt;
                                 &lt;Field className="form-control col-md-2 mr-2" type="text"
                                                             name={`dateList[${index}].date`} readOnly/&gt;
  
                      &lt;/Formik&gt;)
                  }
              &lt;/div&gt;
          )
      }
  }
  
  export default DateComponent;
  
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>dateList[{
  id:"some id"
  date:"2019-08-16"
  }]
  
  </code></pre>
  
  <p>Without convert convertDatesToTimezoneUTC() function everything is alright and return data properly. Did I miss something ?</p>