vue2-datepicker: Bad behaviour with not-before and time-list

Hi,

I found an unexpected behaviour when using the not-before option with new Date().

It is currently 17h57 and when the time picker is displayed, the hour 17 and minute 57 are both actived and disabled.

Capture d’écran 2019-03-30 à 17 55 20 Capture d’écran 2019-03-30 à 17 58 19

When I click on the minute 58 for example, the disabledclass disappear for the hour and now the actived is used (what it is expected by default).

Capture d’écran 2019-03-30 à 17 58 41 Capture d’écran 2019-03-30 à 17 58 32

I temporarily fixed this by using !important on properties in the actived class but this is not a long-term solution…

I think this is a bug, what do you think about that?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@danstoian07 use disabledDate.https://mengxiong10.github.io/vue2-datepicker/index.html#DisabledDateTime

<date-picker :disabled-date="disabledDate" />

  methods: {
    disabledDate(date) {
      const notBefore = new Date();
      cosnt notAfter = new Date(Date.now() + 24 * 3600 * 1000)
      return date < notBefore || date > notAfter;
    },
}