filterDates(data) {
		let today = this.state.selectedDate;
		let dd = String(today.getDate()).padStart(2, '0');
		let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
		let yyyy = today.getFullYear();

		let date = yyyy + "-" + mm + "-" + dd
		let res = Object.entries(data).filter(([key, val]) => {
			const myArr = val.dt_txt.split(" ");
			const time = myArr[1].split(":")
			console.log(date === myArr[0] && 12 <= time[0] && time[0] <= 18)
			return date === myArr[0] && 12 <= time[0] && time[0] <= 18
		}
		)
		return res
	}
// Method to filterout data from api calls based on the date entered by user
Method to filterout data from api calls based on the date entered by user
Method to filterout data from api calls based on the date entered by user
filterDates(data) {
		let today = this.state.selectedDate;
		let dd = String(today.getDate()).padStart(2, '0');
		let mm = String(today.getMonth() + 1).padStart(2, '0'); 
		let yyyy = today.getFullYear();
		let date = yyyy + "-" + mm + "-" + dd
		let res = Object.entries(data).filter(([key, val]) => {
			const myArr = val.dt_txt.split(" ");
			const time = myArr[1].split(":")
			console.log(date === myArr[0] && 12 <= time[0] && time[0] <= 18)
			return date === myArr[0] && 12 <= time[0] && time[0] <= 18
		}
		)
		return res
	}
filterDates ( data ) { let today = this . state . selectedDate ; let dd = String ( today . getDate ( ) ) . padStart ( 2 , '0' ) ; let mm = String ( today . getMonth ( ) + 1 ) . padStart ( 2 , '0' ) ; let yyyy = today . getFullYear ( ) ; let date = yyyy + "-" + mm + "-" + dd let res = Object . entries ( data ) . filter ( ( [ key , val ] ) => { const myArr = val . dt_txt . split ( " " ) ; const time = myArr [ 1 ] . split ( ":" ) console . log ( date === myArr [ 0 ] && 12 <= time [ 0 ] && time [ 0 ] <= 18 ) return date === myArr [ 0 ] && 12 <= time [ 0 ] && time [ 0 ] <= 18 } ) return res }
Method to filterout data from api calls based on the date entered by user
Method to filterout data from api calls based on the date entered by user
//January is 0!