release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
4 changed files with 13 additions and 15 deletions
Showing only changes of commit 1316c47706 - Show all commits

View File

@ -93,7 +93,7 @@ export default defineComponent({
if (list) if (list)
list.forEach((event) => { list.forEach((event) => {
let day = event.start.getDay(); let day = event.start.getDay();
console.log('event', event, day, !agenda[day]);
if (!agenda[day]) { if (!agenda[day]) {
agenda[day] = []; agenda[day] = [];
} }

View File

@ -16,7 +16,9 @@
<div v-for="(job, index) in event.jobs" :key="index"> <div v-for="(job, index) in event.jobs" :key="index">
<q-separator style="justify-start content-center" /> <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"> <div class="q-px-xs">
{{ job.type.name }} {{ job.type.name }}
</div> </div>
@ -68,7 +70,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { defineComponent, ref, onBeforeMount, PropType } from 'vue'; import { defineComponent, ref, onBeforeMount, PropType } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { date, Notify } from 'quasar'; import { Notify } from 'quasar';
import { asHour } from 'src/utils/datetime'; import { asHour } from 'src/utils/datetime';
import { useUserStore } from 'src/plugins/user/store'; import { useUserStore } from 'src/plugins/user/store';
import { useMainStore } from 'src/store'; import { useMainStore } from 'src/store';
@ -77,13 +79,6 @@ import { useScheduleStore } from 'src/plugins/schedule/store';
export default defineComponent({ export default defineComponent({
name: 'Eventslot', name: 'Eventslot',
components: {}, components: {},
filters: {
formatToHour: function (value: Date) {
if (value) {
return date.formatDate(value, 'HH:mm');
}
},
},
props: { props: {
event: { event: {
required: true, required: true,
@ -113,7 +108,6 @@ export default defineComponent({
} }
function jobFull(job: FG.Job) { function jobFull(job: FG.Job) {
console.log('jobFull', job.services.length >= job.required_services);
return job.services.length >= job.required_services; return job.services.length >= job.required_services;
} }
@ -146,7 +140,6 @@ export default defineComponent({
userid: mainStore.currentUser.userid, userid: mainStore.currentUser.userid,
value: -1, value: -1,
}; };
try { try {
await store.updateEvent(props.event.id, job.id, { user: newService }); await store.updateEvent(props.event.id, job.id, { user: newService });
} catch (error) { } catch (error) {

View File

@ -8,7 +8,12 @@ interface UserService {
function fixEvent(event: FG.Event) { function fixEvent(event: FG.Event) {
event.start = new Date(event.start); 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({ export const useScheduleStore = defineStore({

View File

@ -17,6 +17,6 @@ export function formatDateTime(
return dateTimeFormat.format(date); return dateTimeFormat.format(date);
} }
export function asHour(date: Date) { export function asHour(date?: Date) {
return formatDateTime(date, false, true); if (date) return formatDateTime(date, false, true);
} }