Huge refactor for backend and client
This is barely functionnal, but at least it can display some data without crashing Most other functionnalities other than displaying events are broken, and so are the relative date operations, they need to be fixed asap
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { areDatesIdentical, type LeimDate } from '@/models/Date'
|
||||
import { areDatesIdentical, type RPGDate } from '@/models/Date'
|
||||
import { useCalendar } from '@/stores/CalendarStore'
|
||||
import { useCalendarEvents } from '@/stores/EventStore'
|
||||
import { storeToRefs } from 'pinia'
|
||||
@@ -14,7 +14,7 @@ const props = defineProps<{
|
||||
dayNumber: number
|
||||
}>()
|
||||
|
||||
const tileDate: ComputedRef<LeimDate> = computed(() => {
|
||||
const tileDate: ComputedRef<RPGDate> = computed(() => {
|
||||
return {
|
||||
day: props.dayNumber,
|
||||
month: props.monthNumber,
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
import { useCalendar } from '@/stores/CalendarStore'
|
||||
import { useThrottleFn } from '@vueuse/core'
|
||||
|
||||
import MonthTile from './MonthTile.vue'
|
||||
|
||||
const { staticConfig, decrementYear, incrementYear } = useCalendar()
|
||||
const { decrementYear, incrementYear } = useCalendar()
|
||||
const { sortedMonths: months } = storeToRefs(useCalendar())
|
||||
|
||||
function handleWheel(e: WheelEvent) {
|
||||
const isMovingUp = e.deltaY < 0
|
||||
@@ -27,10 +26,10 @@ const moveCalendarRight = useThrottleFn(() => {
|
||||
<template>
|
||||
<div class="container mt-[10vh] mb-auto" @wheel="handleWheel">
|
||||
<div class="grid grid-cols-5 gap-x-8 gap-y-16">
|
||||
<MonthTile
|
||||
v-for="month in staticConfig.monthsPerYear"
|
||||
:key="month"
|
||||
:month-number="month - 1"
|
||||
<CalendarStateYearlyMonthTile
|
||||
v-for="month in months"
|
||||
:key="month.id"
|
||||
:month
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
<script lang="ts" setup>
|
||||
import { useCalendar } from '@/stores/CalendarStore'
|
||||
import type { CalendarMonth } from '~/models/CalendarMonth';
|
||||
|
||||
import DayTile from './DayTile.vue'
|
||||
|
||||
const { staticConfig, getMonthName } = useCalendar()
|
||||
|
||||
const props = defineProps<{
|
||||
monthNumber: number
|
||||
defineProps<{
|
||||
month: CalendarMonth
|
||||
}>()
|
||||
|
||||
const tileMonthName: string = getMonthName(props.monthNumber)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div class="font-medium">
|
||||
{{ tileMonthName }}
|
||||
{{ month.name }}
|
||||
</div>
|
||||
<div class="grid grid-cols-7">
|
||||
<DayTile
|
||||
v-for="day in staticConfig.daysPerMonth"
|
||||
<CalendarStateYearlyDayTile
|
||||
v-for="day in month.days"
|
||||
:key="day"
|
||||
:month-number="monthNumber"
|
||||
:month-number="month.position"
|
||||
:day-number="day"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user