Disabling save button when dateDif is negative, replacing non-functional invisible button(?) with proper spacing
This commit is contained in:
Andreas Waschinski 2021-02-24 17:47:39 +01:00
commit 45f0fe4bbe

View file

@ -69,16 +69,14 @@
<MealPlanCard v-model="meals" /> <MealPlanCard v-model="meals" />
</v-card-text> </v-card-text>
<v-row align="center" justify="end"> <v-row align="center" justify="end">
<v-card-actions> <v-card-actions class="mr-5">
<v-btn color="success" @click="random" v-if="meals[1]" text> <v-btn color="success" @click="random" v-if="meals.length > 0" text>
{{ $t("general.random") }} {{ $t("general.random") }}
</v-btn> </v-btn>
<v-btn color="success" @click="save" text> <v-btn color="success" @click="save" text :disabled="meals.length == 0">
{{ $t("general.save") }} {{ $t("general.save") }}
</v-btn> </v-btn>
<v-spacer></v-spacer>
<v-btn icon @click="show = !show"> </v-btn>
</v-card-actions> </v-card-actions>
</v-row> </v-row>
</v-card> </v-card>
@ -136,7 +134,7 @@ export default {
let dateDif = (endDate - startDate) / (1000 * 3600 * 24) + 1; let dateDif = (endDate - startDate) / (1000 * 3600 * 24) + 1;
if (dateDif <= 1) { if (dateDif < 1) {
return null; return null;
} }