Skip to content

The type of minute in props disabledDateTime of DatePicker should be number, not a ComputedRef . #6231

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

Closed
1 task done
baohangxing opened this issue Feb 6, 2023 · 3 comments

Comments

@baohangxing
Copy link
Contributor

baohangxing commented Feb 6, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.14

Environment

"vue": "^3.2.36"

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. select date
  2. see log in Console

What is expected?

The type of minute in porps disabledDateTime of DatePicker should be number

What is actually happening?

The type of minute in porps disabledDateTime of DatePicker is a ComputedRef.


in file ant-design-vue/es/vc-picker/interface.d.ts

The type of minute in porps disabledDateTime of DatePicker declared as number

export declare type DisabledTimes = {
    disabledHours?: () => number[];
    disabledMinutes?: (hour: number) => number[];
    disabledSeconds?: (hour: number, minute: number) => number[];
};

:)

@github-actions github-actions bot changed the title The type of minute in porps disabledDateTime of DatePicker should be number, not a ComputedRef . The type of minute in porps disabledDateTime of DatePicker should be number, not a ComputedRef . Feb 6, 2023
@baohangxing
Copy link
Contributor Author

to fix it with the following way if developer don't fix it . :)

const disabledDateTime = (current: Dayjs | null) => {
  return {
    disabledSeconds: (hour: number, minute: number) => {

      // fix minute bug, minute is a ComputedRef<number>
      const realMinute = ref(minute).value;

      //...
    },
  };
};

@baohangxing baohangxing changed the title The type of minute in porps disabledDateTime of DatePicker should be number, not a ComputedRef . The type of minute in props disabledDateTime of DatePicker should be number, not a ComputedRef . Feb 6, 2023
@github-actions
Copy link

github-actions bot commented Apr 8, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Copy link

github-actions bot commented Apr 8, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant