Within the following code snippet, there is a date present. Is it possible to exclusively extract the year from q-date? I am aiming to automatically close the div when the model or container reaches a length of 4, which I have already achieved. However, upon clicking the date, the q-date does not appear since I have set it to false. How can I revert it back to true?
<q-input
style="width: 200px"
outlined
v-model="advance_search.advance_year_option_year_start"
mask="####"
label="Start Year"
stack-label
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer" >
<q-popup-proxy
v-if="qDateClose"
cover
transition-show="scale"
transition-hide="scale"
>
<q-date
v-model="advance_search.advance_year_option_year_start"
@update:model-value="closeQDate(advance_search.advance_year_option_year_start)"
default-view="Years"
mask="YYYY"
emit-immediately
minimal
/>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
Included JavaScript portion:
let qDateClose = ref(true);
let closeQDate = (value) => {
if(value.length == 4){
qDateClose.value = false;
}
};
Alternatively, feel free to suggest another approach.