I own a little game and my coder is not available. After an update he did, I have this error "date.getTime is not a function" in the console that causes crashes and I'm alone and very novice. I'd like you guys to please help me understand on how to solve it. Thanks
hasPlayedInTheWeek(date) {
var lastMonday = new Date();
lastMonday.setDate(lastMonday.getDate() - (lastMonday.getDay()-1));
lastMonday.setHours(0,0,0,0);
const res = lastMonday.getTime() < date.getTime() && date.getTime() < ( lastMonday.getTime() + 604800000);
return res;
}