lyne-components
lyne-components copied to clipboard
fix(sbb-time-input, sbb-datepicker): create get/set for valueAsDate
Preflight Checklist
- [x] I have read the Contributing Guidelines for this project.
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the pull request tracker for a Pull Request (PR) that matches the one I want to submit, without success.
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
andsetValueAsDate
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();