From 0248517c6845a6c755d40c89d3d769ce7d60bd03 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Thu, 23 Jan 2025 15:59:58 +0000
Subject: Some more shit

---
 pages/live.vue | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

(limited to 'pages/live.vue')

diff --git a/pages/live.vue b/pages/live.vue
index b181ff0..1c5679f 100644
--- a/pages/live.vue
+++ b/pages/live.vue
@@ -1,10 +1,40 @@
 <script setup lang="ts">
 import Panel from '~/components/Panel.vue';
+import { type Event } from '~/stores/schedule';
 
+const favouritesStore = useFavouritesStore();
+const scheduleStore = useScheduleStore();
+const errorStore = useErrorStore();
+
+const favouriteEvents = computed(() => {
+  return scheduleStore.events.filter((event) => favouritesStore.isFavourite(event));
+});
+const todayEvents = computed(() => {
+  return scheduleStore.events.filter((event) => isToday(new Date(event.start)));
+});
+const happeningNow = computed(() => {
+  return todayEvents.value.filter((event) => isEventHappeningNow(event));
+});
+const favouritesHappeningNow = computed(() => {
+  return happeningNow.value.filter((event) => favouritesStore.isFavourite(event));
+});
+
+function isEventHappeningNow(event: Event): boolean {
+  const now = new Date();
+  return event.start <= now && event.end >= now;
+}
+
+function isToday(date: Date): boolean {
+  const today = new Date();
+  return date.getDate() === today.getDate() &&
+         date.getMonth() === today.getMonth() &&
+         date.getFullYear() === today.getFullYear();
+}
 </script>
 
 <template>
-  <Panel>
+  <Panel kind="success" class="ongoing" v-if="happeningNow.length > 0">
+    
   </Panel>
 
 </template>
-- 
cgit v1.2.3-70-g09d2

