This problem is quite easy but I still can’t handle it.
I have an array of object let’s say something like:
const array = [{id:1,created_at: 2022-03-14T16:40:10.000000Z}, {id:2, created_at:2022-03-15T16:40:10.000000Z}
I want to filter element using moment.js, and having back only the element that have date of creation of today.
What i want to achieved is something like this:
const filtered = array.filter((item)=> item.created_at >= startOfToday && item.created_at <= endOfToday
Filtered will look like: [0]{id:2, created_at:2022-03-15T16:40:10.000000Z}
Thanks in advance for any tips/answers.