lyne-components icon indicating copy to clipboard operation
lyne-components copied to clipboard

fix(sbb-time-input, sbb-datepicker): create get/set for valueAsDate

Open DavideMininni-Fincons opened this issue 1 year ago • 4 comments

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)
  • [x] 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
  • [x] 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?

  • [x] 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 avatar Nov 29 '23 15:11 DavideMininni-Fincons