get it working

This commit is contained in:
Moriz Wahl 2023-02-10 13:33:38 +01:00
parent 64930cfb3f
commit 2e18ca41c9
2 changed files with 10 additions and 5 deletions

View File

@ -23,10 +23,7 @@
<template #nav-next-year><span></span></template>
</b-form-datepicker>
<div
v-if="(isThisMonth && maxGddThisMonth <= 0) || (!isThisMonth && maxGddLastMonth <= 0)"
class="p-3"
>
<div v-if="showMessage" class="p-3">
{{ noOpenCreation }}
</div>
<div v-else>
@ -135,6 +132,15 @@ export default {
},
},
computed: {
showMessage() {
if (this.maxGddThisMonth <= 0 && this.maxGddLastMonth <= 0) return true
if (this.form.date)
return (
(this.isThisMonth && this.maxGddThisMonth <= 0) ||
(!this.isThisMonth && this.maxGddLastMonth <= 0)
)
return false
},
disabled() {
return (
this.form.date === '' ||

View File

@ -188,7 +188,6 @@ export default {
return new Date(date.setMonth(date.getMonth() - 1, 1))
},
isThisMonth() {
if (!this.form.date) return false
const formDate = new Date(this.form.date)
return (
formDate.getFullYear() === this.maximalDate.getFullYear() &&