Fixed some bugs
One issue was a missing ui component and the other was about the previous commit's changes with startDate
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { useCalendar } from '@/stores/CalendarStore'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { PhMagnifyingGlass } from '@phosphor-icons/vue'
|
||||
import CalendarMenuNav from './CalendarMenuNav.vue'
|
||||
import CalendarMenuToday from './CalendarMenuToday.vue'
|
||||
import CalendarSwitch from './CalendarSwitch.vue'
|
||||
|
||||
@@ -139,7 +139,7 @@ const searchResults = computed<(Character | CalendarEvent)[]>(() => {
|
||||
}
|
||||
|
||||
hitCategories = selectedCategories.value.every((selectedCat) => {
|
||||
return allCategories.includes(selectedCat)
|
||||
return allCategories.includes(selectedCat as CalendarEventCategory)
|
||||
})
|
||||
|
||||
return (hitTitle || hitDesc) && hitCategories
|
||||
@@ -162,7 +162,7 @@ const searchResults = computed<(Character | CalendarEvent)[]>(() => {
|
||||
|
||||
// Handle categories logic
|
||||
let hitCategories: boolean = false
|
||||
let allCategories: CalendarEventCategory[] = []
|
||||
let allCategories: CharacterCategory[] = []
|
||||
|
||||
if (item.category) {
|
||||
allCategories.push(item.category)
|
||||
@@ -173,7 +173,7 @@ const searchResults = computed<(Character | CalendarEvent)[]>(() => {
|
||||
}
|
||||
|
||||
hitCategories = selectedCategories.value.every((selectedCat) => {
|
||||
return allCategories.includes(selectedCat)
|
||||
return allCategories.includes(selectedCat as CharacterCategory)
|
||||
})
|
||||
|
||||
return hitTitle && hitCategories
|
||||
|
||||
@@ -53,10 +53,10 @@ const { defaultDate, getFormattedDateTitle } = useCalendar()
|
||||
</div>
|
||||
|
||||
<div class="mb-1 flex gap-4 items-center">
|
||||
<p class="opacity-75">{{ getFormattedDateTitle(event.date, true) }}</p>
|
||||
<p class="opacity-75">{{ getFormattedDateTitle(event.startDate, true) }}</p>
|
||||
<p class="text-sm italic opacity-75 flex items-center gap-1">
|
||||
<PhHourglassMedium size="16" weight="fill" />
|
||||
{{ getRelativeString(defaultDate, event.date) }}
|
||||
{{ getRelativeString(defaultDate, event.startDate) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ const sortedResults = computed(() => {
|
||||
let secondDate: LeimDate
|
||||
|
||||
if (isCalendarEvent(a)) {
|
||||
firstDate = a.date
|
||||
firstDate = a.startDate
|
||||
} else if (isCharacter(a) && a.birth) {
|
||||
firstDate = a.birth
|
||||
} else {
|
||||
@@ -44,7 +44,7 @@ const sortedResults = computed(() => {
|
||||
}
|
||||
|
||||
if (isCalendarEvent(b)) {
|
||||
secondDate = b.date
|
||||
secondDate = b.startDate
|
||||
} else if (isCharacter(b) && b.birth) {
|
||||
secondDate = b.birth
|
||||
} else {
|
||||
@@ -62,7 +62,7 @@ const pagedResults = computed(() => sortedResults.value.slice(props.startAt, pro
|
||||
<template>
|
||||
<ul class="grid gap-4">
|
||||
<li v-for="r in pagedResults" :key="isCalendarEvent(r) ? r.title : r.name">
|
||||
<EventCallout v-if="isCalendarEvent(r)" @click="handleJumpToDate(r.date)" :event="r" />
|
||||
<EventCallout v-if="isCalendarEvent(r)" @click="handleJumpToDate(r.startDate)" :event="r" />
|
||||
|
||||
<CharacterCallout
|
||||
v-else-if="isCharacter(r)"
|
||||
|
||||
Reference in New Issue
Block a user