Filtering data in react

const filteredSubscriptions=subscriptions.filter((item)=>{

return item.date.getFullYear().toString() === filteredYear

})

this code showing error “get full year is not a function”

https://forums.learnvern.com/t/in-reactjs-course-jsx-module/3187/2?u=ui.dev91

so i have to use this const theDate = new Date(props.date)
variable inside the const filteredsubcriptions

It is showing error in this block inside app.js component file

 const filterBookData=bookdetails.filter((items)=>{       return items.date.getFullYear().toString() === filteredYear  })

Share your project code here to check
https://stackblitz.com/