Added category input component
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import type { RPGDate } from '@/models/Date'
|
||||
import type { CalendarEvent } from '@/models/CalendarEvent'
|
||||
import type { RPGDate } from '@/models/Date'
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, watch, type Ref } from 'vue'
|
||||
import type { Category } from '~/models/Category'
|
||||
import { useCalendar } from './CalendarStore'
|
||||
|
||||
export const useCalendarEvents = defineStore('calendar-events', () => {
|
||||
@@ -14,6 +15,12 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
|
||||
baseEvents.value = data
|
||||
}
|
||||
|
||||
const categories = ref<Category[]>([])
|
||||
|
||||
function setCategories(data: Category[]) {
|
||||
categories.value = data
|
||||
}
|
||||
|
||||
// Order base events by dates
|
||||
const allEvents = computed(() => baseEvents.value.sort((a, b) => {
|
||||
return compareDates(a.startDate, b.startDate, 'desc')
|
||||
@@ -269,6 +276,8 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
|
||||
return {
|
||||
allEvents,
|
||||
setEvents,
|
||||
categories,
|
||||
setCategories,
|
||||
currentEvents,
|
||||
getRelativeEventFromDate,
|
||||
getRelativeEventFromEvent,
|
||||
|
||||
Reference in New Issue
Block a user