praveenpuglia / vuetify-daterange-picker

The missing date range picker for Vuetify JS you have been looking for.
https://vuetify-daterange-picker.gitbook.io/docs
MIT License
197 stars 59 forks source link

Allow to pick dates on one month only #25

Closed pwnz22 closed 5 years ago

pwnz22 commented 5 years ago

Hello guys!

Please help to set options for my needs.

I want to allow to user to pick dates in range of one month of any year. Thanks.

praveenpuglia commented 5 years ago

You can already do that using the minDate and maxDate options. Did you try using those values?

pwnz22 commented 5 years ago

Yes, i tried, but didnt get what i need. I dont know which values to set to allow user to pick any dates between any month of one year. For example i can pick: 01.05.2018 - 20.05.2018 but not 01.05.2018 - 20.06.2018.

Can you explain how to use that options.

praveenpuglia commented 5 years ago

How about setting minDate: '2018-05-01' & maxDate: '2018-05-20' ?

pwnz22 commented 5 years ago

Look user can choose any day from one month and any year. I have restriction of picking between one month. Examples of user can pick:

2017-05-01 - 2017-05-30 2018-01-20 - 2018-01-25 But not:

2017-05-01 - 2017-06-05 2018-02-20 - 2018-03-25

etc...

praveenpuglia commented 5 years ago

oh! okay. Now I got it. So you want to allow the duration to be max a month doesn't matter which month it is.

Currently, there's no way to do this. I'll have to think about the API a little and get back to you with a solution soon.

mariokresic commented 5 years ago

You can use computed props to change maxDate prop.

something like

minDate = firstPickedDate; maxDate = minDate + 30days

praveenpuglia commented 5 years ago

I have looked into this but it seems like @mariokresic 's way is the most convenient way of doing this right now. Anything else I tried required change to the actual datepicker component which is not possible from this component.