The functionality of the timepicker in Quasar doesn't quite meet my expectations. I don't want to add another library just for this feature. The main issue I have is that it doesn't close automatically after selecting a time. I managed to figure out how to use the date picker, but the time picker is still a challenge. The closest solution I found was to check the v-model for a value. If there is a value, I close the picker. However, the problem with this approach is that I can't reopen the picker without clearing the input field.
Here's the current workaround I implemented:
<div id="q-app">
<div class="q-pa-md">
<div class="q-gutter-sm row">
<q-input filled v-model="time" mask="time" :rules="['time']">
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-proxy
ref="qTimeProxy"
transition-show="scale"
transition-hide="scale">
<q-time
v-model="time"
v-if="!time ? () => $refs.qTimeProxy.hide() : null">
</q-time>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</div>
</div>
</div>
This setup is not ideal and I'm looking for a way to improve it so I can reopen the picker even if a time is already selected, while ensuring that it closes after a new time is picked.
One major drawback is that this implementation does not consider AM/PM selection. Selecting a time without specifying AM or PM can be inefficient. Has anyone encountered this issue before?
For a live example, you can visit the PLAYGROUND
Thank you in advance