ankurk91 / vue-bootstrap-datetimepicker

Vue.js component for eonasdan bootstrap datetimepicker
MIT License
223 stars 66 forks source link

linked picker: config not updated (continue) #22

Closed andrii-trush closed 6 years ago

andrii-trush commented 6 years ago

Hello. Your example from #21 not working correctly. Steps:

  1. Open "End date" picker
  2. Chose date in the "Start date" picker
  3. Open again "End date" picker

Actual result: And you see that days are available, which are before start date

Expected result: Days have to be not available, which are before start date

ankurk91 commented 6 years ago

Your issue title says "config not updated" and I showed you how you can update config dynamically.

andrii-trush commented 6 years ago

@ankurk91 Yes. But it does not update config dynamically. Before I have had other issue, but cannot reproduce now ((( a

ankurk91 commented 6 years ago

It is working fine for me. peek 2017-12-22 16-59 Configs are being updated. It is upto you; how to restrict user from selecting dates.

andrii-trush commented 6 years ago

@ankurk91 If you select End date first - it works incorrect (((

ankurk91 commented 6 years ago

You meant I need to select end date first and then start date? OR You are saying that I have selected end date first in my GIF.

andrii-trush commented 6 years ago

You meant I need to select end date first and then start date?

Yes. Look at my gif. You see an error )))

ankurk91 commented 6 years ago

I think i got your issue, now. In this example, start date has a minDate of today and if we select an end date before todays date; the "start date" input field locks down. This issue can be fixed by setting minDate on end date field. Check the updated fiddle. https://jsfiddle.net/w99v77k4/5/ peek 2017-12-22 18-43

You can configure datepickers like this as well. http://eonasdan.github.io/bootstrap-datetimepicker/#linked-pickers

andrii-trush commented 6 years ago

@ankurk91 Ok. Click step by step:

  1. Select start date 28/12/2017
  2. Select end date 30/12/2017
  3. Select start date 23/12/2017

In end date you cannot select from 24/12 to 27/12

Other issue:

  1. Select start date 25/12/2017
  2. Select end date 30/12/2017
  3. Select start date 27/12/2017

You can select 25/12 and 26/12 as end date, but your start date is 27/12

ankurk91 commented 6 years ago

I was able to reproduce your first case. I found that Vue.js can is not detecting change in minDate because it is moment js object. I will keep you posted, if i found a solution.

andrii-trush commented 6 years ago

@ankurk91 Thanks. Will wait, because i really require this issue )))

ankurk91 commented 6 years ago

@andrii-trush This issue has been fixed in v4.1.1 Thanks for reporting and steps to re-produce.