Skip to content
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

Disabled time not checking for PM timing #664

Closed
Benana89 opened this issue Nov 30, 2021 · 5 comments
Closed

Disabled time not checking for PM timing #664

Benana89 opened this issue Nov 30, 2021 · 5 comments

Comments

@Benana89
Copy link

Benana89 commented Nov 30, 2021

<date-picker v-model="newDate" :value-type="YYYY-MM-DD hh:mm A" :format="hh:mm A" :type="time" :default-value="defaultDate" :disabled-time="disableTime"></date-picker>

I set the var disableTime to Tue Nov 30 2021 15:39:00 GMT+0800 and my newDate to 2021-11-30 00:00 AM. All the selection for timepicker dropdown is being disabled, and the date param for the disableTime, it only return me date time from 1 -12 AM, even i set the disabled to be 15:39PM, How can i check for PM timing?

@mengxiong10
Copy link
Owner

which version do you use? And can you should you code with more detail?

@Benana89
Copy link
Author

Benana89 commented Dec 2, 2021

Vue2-datepicker version: 3.9.2
Vue version: 2.6.11

time reproduce: 3:00 PM
Steps to reproduce

Set :format="hh:mm A" to display as 12 hr
Set the v-model to 12:00 AM
Set :disabled-time to disableTime function and disableTimeValue set to 1:00 PM

disableTime(date: Date): boolean {
    if (this.disableTimeValue) {
      
      return date.getTime() < this.disableTimeValue.getTime();
    }
    return false;
  };

Expected behavior

AM selection is disabled
PM selection can be selected for time after 1:00PM

Actual behavior

All the time selection in Time dropdown is disabled
Screenshot 2021-12-02 at 10 13 51 AM

@mengxiong10
Copy link
Owner

You can use v3.10.x.

@Benana89
Copy link
Author

Benana89 commented Dec 2, 2021

Updated to v3.10.3

The date param in disableTime return only the range from 00:00 - 12:00 GMT which is not in range for my disable timing 13:00 GMT

Screenshot 2021-12-02 at 3 16 12 PM

mengxiong10 added a commit that referenced this issue Dec 2, 2021
@mengxiong10
Copy link
Owner

Thanks for feedback. I have fixed it in 3.10.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants