refactor(events): move 'now' into filteredEvents computed
This commit is contained in:
parent
a6304e1c23
commit
a2f881e805
1 changed files with 1 additions and 2 deletions
|
|
@ -133,9 +133,8 @@ const filterOptions = [
|
|||
const { data: eventsData } = await useFetch("/api/events");
|
||||
const { data: seriesData } = await useFetch("/api/series");
|
||||
|
||||
const now = new Date();
|
||||
|
||||
const filteredEvents = computed(() => {
|
||||
const now = new Date();
|
||||
if (!eventsData.value) return [];
|
||||
return eventsData.value.filter((event) => {
|
||||
if (!includePastEvents.value && new Date(event.startDate) < now)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue