release v2.0.0 #4
|
@ -93,7 +93,7 @@ export default defineComponent({
|
|||
if (list)
|
||||
list.forEach((event) => {
|
||||
let day = event.start.getDay();
|
||||
console.log('event', event, day, !agenda[day]);
|
||||
|
||||
if (!agenda[day]) {
|
||||
agenda[day] = [];
|
||||
}
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
|
||||
<div v-for="(job, index) in event.jobs" :key="index">
|
||||
<q-separator style="justify-start content-center" />
|
||||
<div class="text-weight-medium q-px-xs">{{ asHour(job.start) }} - {{ asHour(job.end) }}</div>
|
||||
<div class="text-weight-medium q-px-xs">
|
||||
{{ asHour(job.start) }} <template v-if="job.end">- {{ asHour(job.end) }}</template>
|
||||
</div>
|
||||
<div class="q-px-xs">
|
||||
{{ job.type.name }}
|
||||
</div>
|
||||
|
@ -68,7 +70,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
import { defineComponent, ref, onBeforeMount, PropType } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { date, Notify } from 'quasar';
|
||||
import { Notify } from 'quasar';
|
||||
import { asHour } from 'src/utils/datetime';
|
||||
import { useUserStore } from 'src/plugins/user/store';
|
||||
import { useMainStore } from 'src/store';
|
||||
|
@ -77,13 +79,6 @@ import { useScheduleStore } from 'src/plugins/schedule/store';
|
|||
export default defineComponent({
|
||||
name: 'Eventslot',
|
||||
components: {},
|
||||
filters: {
|
||||
formatToHour: function (value: Date) {
|
||||
if (value) {
|
||||
return date.formatDate(value, 'HH:mm');
|
||||
}
|
||||
},
|
||||
},
|
||||
props: {
|
||||
event: {
|
||||
required: true,
|
||||
|
@ -113,7 +108,6 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
function jobFull(job: FG.Job) {
|
||||
console.log('jobFull', job.services.length >= job.required_services);
|
||||
return job.services.length >= job.required_services;
|
||||
}
|
||||
|
||||
|
@ -146,7 +140,6 @@ export default defineComponent({
|
|||
userid: mainStore.currentUser.userid,
|
||||
value: -1,
|
||||
};
|
||||
|
||||
try {
|
||||
await store.updateEvent(props.event.id, job.id, { user: newService });
|
||||
} catch (error) {
|
||||
|
|
|
@ -8,7 +8,12 @@ interface UserService {
|
|||
|
||||
function fixEvent(event: FG.Event) {
|
||||
event.start = new Date(event.start);
|
||||
event.end = new Date(event.end);
|
||||
if (event.end) event.end = new Date(event.end);
|
||||
|
||||
event.jobs.forEach((job) => {
|
||||
job.start = new Date(job.start);
|
||||
if (job.end) job.end = new Date(job.end);
|
||||
});
|
||||
}
|
||||
|
||||
export const useScheduleStore = defineStore({
|
||||
|
|
|
@ -17,6 +17,6 @@ export function formatDateTime(
|
|||
return dateTimeFormat.format(date);
|
||||
}
|
||||
|
||||
export function asHour(date: Date) {
|
||||
return formatDateTime(date, false, true);
|
||||
export function asHour(date?: Date) {
|
||||
if (date) return formatDateTime(date, false, true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue