I took data from backend and I want to take one value from that data object and do calculations using that value.
const[scheduleData,setScheduleData] = React.useState();
useEffect(() => {
api.get('api/schedule')
.then((res) => {
// console.log(res.data);
setScheduleData(res.data.data);
console.log(res.data.data.data);
})
.catch((err) =>{
// console.log("error")
})
})
There is a value called date is in this data object. I want to take that value and compare it with today and want to print whether is it expired or not.