Update Boat selection component
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m33s

This commit is contained in:
2023-12-31 15:04:53 -05:00
parent 96dab93483
commit f30848803b

View File

@@ -66,7 +66,7 @@
<q-option-group
:options="boatoptions(boat)"
type="radio"
:model-value="selectedTime"
v-model="selectedBoatTime"
>
<template v-slot:label="opt">
<div class="row items-center">
@@ -110,6 +110,7 @@ const calendar = ref();
const boatStore = useBoatStore();
const scheduleStore = useScheduleStore();
const selectedDate = ref(today());
const selectedBoatTime = ref();
const formattedMonth = computed(() => {
const date = new Date(selectedDate.value);
@@ -122,10 +123,6 @@ const disabledBefore = computed(() => {
return addToDate(todayTs, { day: -1 }).date;
});
const selectedTime = computed(() => {
return boatStore.boats[0] + ':09:00';
});
function monthFormatter() {
try {
return new Intl.DateTimeFormat('en-CA' || undefined, {
@@ -152,9 +149,11 @@ const boatoptions = (boat: Boat) => {
const conflicts = getConflicts(x, boat);
return {
label: x.start.time + ' to ' + x.end.time,
value: boat.name + ':' + x.start.time,
value: boat.id + ':' + x.start.time,
disable: conflicts.length > 0,
user: conflicts[0]?.user,
boat: boat,
timeblock: x,
};
});
return options;