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

fix(components): [date-picker] disable button if now is disabled #13655

Merged
merged 3 commits into from
Jul 29, 2023

Conversation

btea
Copy link
Collaborator

@btea btea commented Jul 19, 2023

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

Description

🤖 Generated by Copilot at 6375356

Add disabled props to date picker panel buttons. This allows users to see when the "Now" and "Confirm" buttons are not available based on the disabledDate and parsedValue props of the date picker component.

Related Issue

Fixes #13643.

Explanation of Changes

🤖 Generated by Copilot at 6375356

  • Add disabled props to "Now" and "Confirm" buttons in date picker panel (link, link)
  • Define disabledConfirm and disabledNow computed properties to check if selected or current date is disabled by disabledDate prop (link, link)
  • Use dayjs library to get current date and set locale according to lang prop in panel-date-pick.vue (link)

@github-actions
Copy link

github-actions bot commented Jul 19, 2023

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label Jul 19, 2023
@github-actions
Copy link

github-actions bot commented Jul 19, 2023

🧪 Playground Preview: https://element-plus.run/?pr=13655
Please comment the example via this playground if needed.

Copy link
Member

@ryuhangyeong ryuhangyeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the test code!

@btea
Copy link
Collaborator Author

btea commented Jul 19, 2023

Please check the test code!

Done.

@btea btea requested a review from ryuhangyeong July 22, 2023 11:45
Copy link
Member

@ryuhangyeong ryuhangyeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion

I wish there was a test code related to the fix~

@ryuhangyeong ryuhangyeong changed the title fix(components): [date-picker] disbale button if now is disabled fix(components): [date-picker] disable button if now is disabled Jul 23, 2023
@btea
Copy link
Collaborator Author

btea commented Jul 26, 2023

Suggestion

I wish there was a test code related to the fix~

Related test cases have been added 🏓

@btea btea merged commit 93b2301 into dev Jul 29, 2023
10 checks passed
@btea btea deleted the fix/disable-button-set-disabledDate branch July 29, 2023 11:21
@element-bot element-bot mentioned this pull request Aug 4, 2023
3 tasks
consultation-applio pushed a commit to consultation-applio/element-plus that referenced this pull request Nov 10, 2023
…ment-plus#13655)

* fix(components): [date-picker] disbale button if now is disabled

* fix: test

* chore: add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommitMessage::Qualified Qualified commit message
Projects
None yet
3 participants