-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Bug] Disabled date inside range #385
Comments
it will be not hard to set disabled all days after disabled date (time) and before previous disabled date(time) when first date selected . I can't to do that via :disabled-date because i haven't event like "first date selected" |
It's a good idea to add the second parameter (the current selected value) to the disabledDate(date, currentValue) {
const firstDate = currentValue[0]
...
} |
And to disabledTime(date, currentValue) also |
v3.2.0 added it. |
Hi. I wrote code for disabled dates and times using current values with whole usability. It's not optimally without some events like 'CurrentValueChanged' and 'ShowingMonthChanged' but working fine. Why do you remove passing those parameters to disabled-date and disabled-time in newest version ? I cant upgrade. |
its working good! Thanks!
|
Hi guys, I cant apply this issue conversation for solve my problem, but i think, it is same. For example: I try work with currentValue but without succes Can u help me ? |
disabledDate(date, currentValue) {
const d13 = // new Date(...).getTime()
const d14 = // ...
const d15 = // ...
// when one date is chosen
if (currentValue.length === 1) {
const firstDate = currentValue[0]
if (firstDate.getTime() < d13) {
return date.getTime() > d13
}
}
return [d13, d14, d15].indexOf(date.getTime()) !== -1
} |
Thank you man!! It works |
Vue2-datepicker version: 3.1.1
Vue version: 2.6.10
Browser: Chrome Version 78.0.3904.108 (Official Build) (64-bit)
Steps to reproduce
:disabled-date="(date) => date.getDate() === 4;"
Then select range from 2 to 6 for example
Expected behavior
Cant select range that has disabled date or time inside.
Actual behavior
Range selected as usual.
The text was updated successfully, but these errors were encountered: