Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to allow selecting another date when multiDates limit is set to 1? #1101

Open
bernardwiesner opened this issue Mar 17, 2025 · 2 comments

Comments

@bernardwiesner
Copy link

Hi, thanks for this awesome project!

I am using multi dates together with a drop-down that allows a user to select multiple dates based on the drop down selection such as 1, 2, 3, 4, etc.

So if a user selects 2 on the drop down, they need to select 2 dates. However if they select 1, they can only select a single date, however I would like to allow them to "replace" the date in case of limit set to 1. Its annoying for the user to first deselect the date, then select a new date for the limit 1 case. For limit > 1, its understandable they first need to deselect as its unclear which date they want to replace.

Let me know if there is a built in way to do this, or a simple solution to get above use case to work.
I tried replacing the date-picker on the fly from non multi-dates to multi-dates, but this creates complexities with regard to passing arrays vs single dates.

<template>
  <VueDatePicker v-model="date" :multi-dates="{ limit: 1 }" />
</template>

<script setup>
import { ref } from 'vue';

const date = ref();
</script>
@Faq
Copy link

Faq commented Mar 17, 2025

Some StackBlitz example would speed up the answer. Also you did not mention what version you use.

@bernardwiesner
Copy link
Author

Hi @Faq

Thanks for the reply. There is really not much to show as its all defaults, but I did create one if you need it:

https://stackblitz.com/edit/vuepic-vue-datepicker-a2guhqxf?file=src%2Fcomponents%2FPlayground.vue

As you can see, with limit set to 1, I can select the first date, but to select another date I first need to de-select then select a new one. I want to be able to select right away any new date when limit is set to 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants