I am having array of objects with date key,i want to filter out the objects which has current week,how can i achieve this which returns me the current week of objects.i tried using filter but first i need to format date key i guess.
const notificationItems = [
{
id: 1,
date: '2021-02-10T05:04:59.525589Z',
name: 'Glenn',
},
{
id: 2,
date: '2021-02-10T05:04:59.525589Z',
name: 'Root',
},
{
id: 3,
date: '2021-01-08T05:04:59.525589Z',
name: 'Smith',
},
{
id: 4,
date: '2019-02-03T05:04:59.525589Z',
name: 'Ryan',
},
{
id: 5,
date: '2019-01-03T05:04:59.525589Z',
name: 'Bob',
}
]