Software/greenhouse-app/src/app/components/App.js
// requesting data when button is pressed
requesting data when button is pressed
requesting data when button is pressed
requesDataByDate() {
    var datePicker = document.getElementById("dateSelector");
    var date = new Date(datePicker.value);
    const dateInit = moment(date).utc().format(); 
    date.setUTCDate(date.getUTCDate() + 1);
    const dateEnd = moment(date).utc().format();
    this.setState({
      dateInit: dateInit,
      dateEnd: dateEnd,
    });
    this.fetchGreenhousebyDate(dateInit, dateEnd);
  }
requesDataByDate ( ) { var datePicker = document . getElementById ( "dateSelector" ) ; var date = new Date ( datePicker . value ) ; const dateInit = moment ( date ) . utc ( ) . format ( ) ; date . setUTCDate ( date . getUTCDate ( ) + 1 ) ; const dateEnd = moment ( date ) . utc ( ) . format ( ) ; this . setState ( { dateInit : dateInit , dateEnd : dateEnd , } ) ; this . fetchGreenhousebyDate ( dateInit , dateEnd ) ; }
requesting data when button is pressed
requesting data when button is pressed
// format("YYYY-MM-D"); // const myDate = moment(date).format("MMM D, YYYY"); // console.log("Data request"); // myDate: myDate,