为什么在 vue-ctk-date-time-picker 中禁用分钟?

Why are the minutes disabled in vue-ctk-date-time-picker?

我正在使用 vue-ctk-date-time-picker 来显示日期时间选择器模式,用户可以在其中选择日期和时间。我使用 minDate 这样用户就不能选择小于当前日期和时间的日期和时间。这与格式 YYYY-MM-DD HH:mm:ss 完美配合,但我需要 AM 和 PM 格式,所以我将格式更改为 YYYY-MM-DD HH:mm a。现在,相当于上午日期的下午也被禁用了。

例如,它是 8:30 上午,因此选择器会禁用所有 30 分钟,用户只能 select 31、32 等等。但是如果我 select PM,分钟仍然被禁用,即用户只能从 31 中选择,当它还没有 PM 时。

有人遇到过这个问题吗?是不是包本身有问题?

对于遇到此问题的任何其他人,这是根据此处文档的解决方案:https://github.com/chronotruck/vue-ctk-date-time-picker#behaviour

In order to avoid having too much properties in the component, We're adding a behaviour property that is an object including some annex behaviour values.

The default value for this object is:

{
  time: {
    nearestIfDisabled: true;
  }
}

To override those values, pass a new object with the values you want to override:

<ctk-date-time-picker
  :behaviour="{
    time: {
      nearestIfDisabled: false
    }
  }"
/>