Update Boat selection component
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m33s
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m33s
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
<q-option-group
|
<q-option-group
|
||||||
:options="boatoptions(boat)"
|
:options="boatoptions(boat)"
|
||||||
type="radio"
|
type="radio"
|
||||||
:model-value="selectedTime"
|
v-model="selectedBoatTime"
|
||||||
>
|
>
|
||||||
<template v-slot:label="opt">
|
<template v-slot:label="opt">
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
@@ -110,6 +110,7 @@ const calendar = ref();
|
|||||||
const boatStore = useBoatStore();
|
const boatStore = useBoatStore();
|
||||||
const scheduleStore = useScheduleStore();
|
const scheduleStore = useScheduleStore();
|
||||||
const selectedDate = ref(today());
|
const selectedDate = ref(today());
|
||||||
|
const selectedBoatTime = ref();
|
||||||
|
|
||||||
const formattedMonth = computed(() => {
|
const formattedMonth = computed(() => {
|
||||||
const date = new Date(selectedDate.value);
|
const date = new Date(selectedDate.value);
|
||||||
@@ -122,10 +123,6 @@ const disabledBefore = computed(() => {
|
|||||||
return addToDate(todayTs, { day: -1 }).date;
|
return addToDate(todayTs, { day: -1 }).date;
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectedTime = computed(() => {
|
|
||||||
return boatStore.boats[0] + ':09:00';
|
|
||||||
});
|
|
||||||
|
|
||||||
function monthFormatter() {
|
function monthFormatter() {
|
||||||
try {
|
try {
|
||||||
return new Intl.DateTimeFormat('en-CA' || undefined, {
|
return new Intl.DateTimeFormat('en-CA' || undefined, {
|
||||||
@@ -152,9 +149,11 @@ const boatoptions = (boat: Boat) => {
|
|||||||
const conflicts = getConflicts(x, boat);
|
const conflicts = getConflicts(x, boat);
|
||||||
return {
|
return {
|
||||||
label: x.start.time + ' to ' + x.end.time,
|
label: x.start.time + ' to ' + x.end.time,
|
||||||
value: boat.name + ':' + x.start.time,
|
value: boat.id + ':' + x.start.time,
|
||||||
disable: conflicts.length > 0,
|
disable: conflicts.length > 0,
|
||||||
user: conflicts[0]?.user,
|
user: conflicts[0]?.user,
|
||||||
|
boat: boat,
|
||||||
|
timeblock: x,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return options;
|
return options;
|
||||||
|
|||||||
Reference in New Issue
Block a user