vue2-datepicker icon indicating copy to clipboard operation
vue2-datepicker copied to clipboard

[Bug] When disabled-date is specified, we can still select Year and Month

Open BaptisteLemarcis opened this issue 5 years ago • 11 comments

Vue2-datepicker version: 3.1.0 Vue version: 2.6.10 Browser: All

Steps to reproduce Add disabled date and click on the month or year button

Reproduction Link or Source Code https://jsfiddle.net/thd0b49w/

Expected behavior In the version 2 the month and year where disabled and not clickable

Actual behavior Even if every date in the month is disabled we can still click on it but cannot click on a day after that

BaptisteLemarcis avatar Nov 22 '19 15:11 BaptisteLemarcis

Since the not-before and not-after are removed in v3.x. It will be difficult to determine if the year is disabled. Need to cycle every day of the year. I consider adding props to implement this feature or built-in this feature

mengxiong10 avatar Nov 29 '19 06:11 mengxiong10

what can we use to replace not-before function, I need that

iqbalme avatar Jan 21 '20 17:01 iqbalme

@iqbalme disabled-date. https://mengxiong10.github.io/vue2-datepicker/index.html#DisabledDateTime

mengxiong10 avatar Jan 24 '20 08:01 mengxiong10

I want to disable date with multiple condition, let say i want to disable date before this month and after today? how can I do it?

iqbalme avatar Jan 25 '20 06:01 iqbalme

    disabledDat(date) {
      
      return date < thisMonth || date > today;
    },
 

mengxiong10 avatar Jan 27 '20 07:01 mengxiong10

wow, it works, thank you so much

iqbalme avatar Jan 27 '20 13:01 iqbalme

    disabledDat(date) {
      
      return date < thisMonth || date > today;
    },
 

Where to add this please?

ohunayogege avatar Mar 19 '20 10:03 ohunayogege

@ohunayogege :disable-date="disableDate"

mengxiong10 avatar Mar 19 '20 10:03 mengxiong10

@ohunayogege :disable-date="disableDate"

Thanks. Solved it since...

But input-class is giving error. "-" is not allowed

ohunayogege avatar Mar 19 '20 15:03 ohunayogege

I would like to add to this: once can also manually enter a value as text input that falls into the disabled range.

BerciTheBeast avatar Apr 24 '20 09:04 BerciTheBeast

I don't know, but I think it fits here. If you disable for example the weekends for the range selection. You can still select a wider range than the week. Would be nice to have some property to enable or disable the selection over disabled dates.

Aristamo avatar Jun 15 '20 14:06 Aristamo