-
Notifications
You must be signed in to change notification settings - Fork 537
Two Datepicker which depend on each other #201
Comments
Hi there! I did this a days ago and work very well:
Hope this works for you! :) |
This works great, but is it also possible to focus on month? If today is March and in first datepicker selected date is somewhere in August, then the second date when selecting should show August. Currently it just starts from March so user has to click multiple times towards August. |
Do you need to add months to the current selected date? For example: You select March 26th and need to focus August 26th, so you add 5 months. Am I right? |
I was thinking about using the code without setDate on second datepicker since by design we have one form which passed data onto second form and I didn't wanted to override data. So I was thinking about only focusing that month in second datepicker without actually setting new date. But talking with my colleagues it seems better to fully follow your code. Thanks again :) |
I'm glad for helping you! But if you later want to implement the pre-focused month you will need to set the date to the wanted month with 'setDate' and use the startView property for start selecting by the month. |
I wanted to do exactly what you wanted to do if I understand correctly. When you select the date in the first datepicker, have the second datepicker move to that same month and disable the dates before the first datepicker but not have the date entered into the input field it is tied to. I know this was posted several months ago but I wanted to share my solution in case anyone else looking to do this found it helpful. So here it is.
|
Hey there, I wanna use your date picker. But I don't know how I can solve my "problem".
I want two date pickers, when I select a date in the first one, I want that its only possible to select dates after that date in the seance one.
The text was updated successfully, but these errors were encountered: