mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-09 09:19:51 +00:00
Fix typing error for the display of text in calendar events
This commit is contained in:
parent
3e7f03d331
commit
4a8d298ae5
6
.changes/unreleased/Fixed-20250505-102715.yaml
Normal file
6
.changes/unreleased/Fixed-20250505-102715.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: Fix display of text in calendar events
|
||||||
|
time: 2025-05-05T10:27:15.461493066+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "372"
|
||||||
|
SchemaChange: No schema change
|
@ -96,23 +96,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||||
<template v-slot:eventContent="{ arg }: { arg: { event: EventApi } }">
|
<template v-slot:eventContent="{ event }">
|
||||||
<span :class="eventClasses(arg.event)">
|
<span :class="eventClasses(event)">
|
||||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
<b v-if="event.extendedProps.is === 'remote'">{{
|
||||||
arg.event.title
|
event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
<b v-else-if="event.extendedProps.is === 'range'"
|
||||||
>{{ arg.event.startStr }} -
|
>{{ formatDate(event.startStr) }} -
|
||||||
{{ arg.event.extendedProps.locationName }}</b
|
{{ event.extendedProps.locationName }}</b
|
||||||
>
|
>
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
<b v-else-if="event.extendedProps.is === 'local'">{{
|
||||||
arg.event.title
|
event.title
|
||||||
}}</b>
|
}}</b>
|
||||||
<b v-else>no 'is'</b>
|
<b v-else>no 'is'</b>
|
||||||
<a
|
<a
|
||||||
v-if="arg.event.extendedProps.is === 'range'"
|
v-if="event.extendedProps.is === 'range'"
|
||||||
class="fa fa-fw fa-times delete"
|
class="fa fa-fw fa-times delete"
|
||||||
@click.prevent="onClickDelete(arg.event)"
|
@click.prevent="onClickDelete(event)"
|
||||||
>
|
>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
@ -221,13 +221,12 @@ import type {
|
|||||||
DatesSetArg,
|
DatesSetArg,
|
||||||
EventInput,
|
EventInput,
|
||||||
} from "@fullcalendar/core";
|
} from "@fullcalendar/core";
|
||||||
import { reactive, computed, ref, onMounted } from "vue";
|
import { computed, ref, onMounted } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { key } from "./store";
|
import { key } from "./store";
|
||||||
import FullCalendar from "@fullcalendar/vue3";
|
import FullCalendar from "@fullcalendar/vue3";
|
||||||
import frLocale from "@fullcalendar/core/locales/fr";
|
import frLocale from "@fullcalendar/core/locales/fr";
|
||||||
import interactionPlugin, {
|
import interactionPlugin, {
|
||||||
DropArg,
|
|
||||||
EventResizeDoneArg,
|
EventResizeDoneArg,
|
||||||
} from "@fullcalendar/interaction";
|
} from "@fullcalendar/interaction";
|
||||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||||
@ -237,19 +236,13 @@ import {
|
|||||||
EventDropArg,
|
EventDropArg,
|
||||||
EventClickArg,
|
EventClickArg,
|
||||||
} from "@fullcalendar/core";
|
} from "@fullcalendar/core";
|
||||||
import {
|
import { dateToISO, ISOToDate } from "ChillMainAssets/chill/js/date";
|
||||||
dateToISO,
|
|
||||||
ISOToDate,
|
|
||||||
} from "../../../../../ChillMainBundle/Resources/public/chill/js/date";
|
|
||||||
import VueMultiselect from "vue-multiselect";
|
import VueMultiselect from "vue-multiselect";
|
||||||
import { Location } from "../../../../../ChillMainBundle/Resources/public/types";
|
import { Location } from "ChillMainAssets/types";
|
||||||
import EditLocation from "./Components/EditLocation.vue";
|
import EditLocation from "./Components/EditLocation.vue";
|
||||||
import { useI18n } from "vue-i18n";
|
|
||||||
|
|
||||||
const store = useStore(key);
|
const store = useStore(key);
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const showWeekends = ref(false);
|
const showWeekends = ref(false);
|
||||||
const slotDuration = ref("00:15:00");
|
const slotDuration = ref("00:15:00");
|
||||||
const slotMinTime = ref("09:00:00");
|
const slotMinTime = ref("09:00:00");
|
||||||
@ -301,6 +294,11 @@ const nextWeeks = computed((): Weeks[] =>
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const formatDate = (datetime: string) => {
|
||||||
|
console.log(typeof datetime);
|
||||||
|
return ISOToDate(datetime);
|
||||||
|
};
|
||||||
|
|
||||||
const baseOptions = ref<CalendarOptions>({
|
const baseOptions = ref<CalendarOptions>({
|
||||||
locale: frLocale,
|
locale: frLocale,
|
||||||
plugins: [interactionPlugin, timeGridPlugin],
|
plugins: [interactionPlugin, timeGridPlugin],
|
||||||
@ -353,7 +351,7 @@ const pickedLocation = computed<Location | null>({
|
|||||||
* return the show classes for the event
|
* return the show classes for the event
|
||||||
* @param arg
|
* @param arg
|
||||||
*/
|
*/
|
||||||
const eventClasses = function (arg: EventApi): object {
|
const eventClasses = function (): object {
|
||||||
return { calendarRangeItems: true };
|
return { calendarRangeItems: true };
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -431,7 +429,6 @@ function onEventDropOrResize(payload: EventDropArg | EventResizeDoneArg) {
|
|||||||
if (payload.event.extendedProps.is !== "range") {
|
if (payload.event.extendedProps.is !== "range") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const changedEvent = payload.event;
|
|
||||||
|
|
||||||
store.dispatch("calendarRanges/patchRangeTime", {
|
store.dispatch("calendarRanges/patchRangeTime", {
|
||||||
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user