This commit is contained in:
Sean Morley
2024-10-07 19:51:45 -04:00
parent 8a1acb5d04
commit 7d9bc16588
2 changed files with 17 additions and 22 deletions

View File

@@ -266,8 +266,11 @@ export function isAdventureVisited(adventure: Adventure) {
const currentTime = Date.now();
// Check if any visit's start_date is before the current time.
return adventure.visits.some((visit) => {
const visitStartTime = new Date(visit.start_date).getTime();
return visit.start_date && visitStartTime <= currentTime;
});
return (
adventure.visits &&
adventure.visits.some((visit) => {
const visitStartTime = new Date(visit.start_date).getTime();
return visit.start_date && visitStartTime <= currentTime;
})
);
}