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(sbb-time-input, sbb-datepicker): create get/set for valueAsDate #2244

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DavideMininni-Fincons
Copy link
Contributor

@DavideMininni-Fincons DavideMininni-Fincons commented Nov 29, 2023

Preflight Checklist

Issue

This PR Closes #2223

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

See Review Guidelines for more information what is checked during review process.

Changes

Changes in this pull request:

  • the two methods getValueAsDate and setValueAsDate have been removed and replaced with a getter/setter

Browsers

I tested the build on the following browsers:

  • Firefox Desktop
  • Chrome Desktop
  • Edge Desktop
  • Safari Desktop
  • Chrome Mobile
  • Safari Mobile

Screen readers

I tested the build on the following browsers:

  • JAWS Firefox Desktop
  • JAWS Chrome Desktop
  • NVDA Firefox Desktop
  • NVDA Chrome Desktop
  • VoiceOver Safari Desktop
  • VoiceOver Chrome Desktop
  • VoiceOver Safari Mobile
  • Android Accessibility Suite Chrome Mobile

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Does this introduce a breaking change?

  • Yes
  • No

BREAKING CHANGES
Consumers which uses the two methods should change them to:

// OLD CODE
const date = <component>.getValueAsDate();
<component>.setValueAsDate(new Date());

// NEW CODE
const date = <component>.valueAsDate;
<component>.valueAsDate = new Date();

Other information

@DavideMininni-Fincons
Copy link
Contributor Author

DavideMininni-Fincons commented Dec 1, 2023

Hello @kyubisation
about this, I noticed that the valueAsDate property is added into the readme file (the related attribute is wrong and the fixi of generation script should be handled in the story #2246 ).
Is this ok for you? Should I add the @property annotation on the setter?

@kyubisation
Copy link
Contributor

I think for the short term this is ok. It is not an attribute, but just a property.
Once we attempt the refactoring for the native form support, we can further investigate how to properly handle this.

@github-actions github-actions bot requested a deployment to preview-pr2244 December 4, 2023 08:53 In progress
@DavideMininni-Fincons DavideMininni-Fincons marked this pull request as ready for review December 4, 2023 08:54
@DavideMininni-Fincons DavideMininni-Fincons changed the title fix: create get/set for valueAsDate fix(sbb-time-input, sbb-datepicker): create get/set for valueAsDate Dec 4, 2023
@github-actions github-actions bot requested a deployment to preview-pr2244 December 4, 2023 09:57 In progress
@github-actions github-actions bot requested a deployment to preview-pr2244 December 4, 2023 16:03 In progress
Copy link
Contributor

@TomMenga TomMenga left a comment

Choose a reason for hiding this comment

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

Good job 👍
Don'r forget to mark the breaking change

@github-actions github-actions bot requested a deployment to preview-pr2244 December 12, 2023 11:44 In progress
@jeripeierSBB
Copy link
Contributor

For two strategy reasons we would like to wait merging this PR

  1. We would like to wait with breaking changes for a couple of weeks until the consumers migrated to lit and will in this period not be overwhelmed with changes
  2. We are planning to support native form support which potentially (probably not) could conflict with some of the changes.

@jeripeierSBB jeripeierSBB added the pr: blocked Pull request is blocked either for merging or reviewing label Feb 5, 2024
@github-actions github-actions bot added the pr: peer review required A peer review is required for this pull request label May 15, 2024
@jeripeierSBB jeripeierSBB added the target: major Pull requests marked with this label should only be merged into main and not into any x.x branches label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: blocked Pull request is blocked either for merging or reviewing pr: peer review required A peer review is required for this pull request target: major Pull requests marked with this label should only be merged into main and not into any x.x branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: turn getValueAsDate/setValueAsDate into a get/set property
5 participants