function filterBySameDay(objectsArray, targetDate) {
return objectsArray.filter(obj => {
const objDate = new Date(obj.dateTime);
const targetDateObj = new Date(targetDate);
return (
objDate.getFullYear() === targetDateObj.getFullYear() &&
objDate.getMonth() === targetDateObj.getMonth() &&
objDate.getDate() === targetDateObj.getDate()
);
});
}