Skip to content

Calendar: Declarative way of setting the selected days #2528

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
ilhan007 opened this issue Nov 30, 2020 · 1 comment · Fixed by #2648
Closed

Calendar: Declarative way of setting the selected days #2528

ilhan007 opened this issue Nov 30, 2020 · 1 comment · Fixed by #2648
Assignees
Milestone

Comments

@ilhan007
Copy link
Member

ilhan007 commented Nov 30, 2020

Is your feature request related to a problem? Please describe.
The Calendar's selectedDates property works only with array of timestamps like calComponent.selectedDates = [1600041600]. But, this is not convenient when the Calendar is used inside a framework, that works with templates (like React) as the selectedDates can't be set in declarative way.

Note: The requirement origins from #2528.

Describe the solution you'd like
To propose and implement API to support declarative way of setting the selected days in the ui5-calendar,
that fits for all 3 types of selection - Single date, Multiple dates and Range of dates.

Prerequisites
The API proposal should be synced with the WCC team, before implementation starts.

Describe alternatives you've considered
Here are are some API proposals that we considered in the past without coming to a final agreement.
These proposals are just FYI. Your API proposal can be something completely different, or combination of the ones below.

  • value property (same as we have in the DatePicker - works perfect for Single date selection:
<ui5-calendar value="11/11/2018">
  • firstValue, lastValue properties - works great for Range selection scenario:
<ui5-calendar firstValue="11/11/2018" lastValue-"20/11/2018">
  • slot and dedicated element - can cover the Multiple selection scenario:
<ui5-calendar>
   <ui5-calendar-date value="11/11/2018"></ui5-calendar-date>
   <ui5-calendar-date value="20/11/2018"></ui5-calendar-date>
  <ui5-calendar-date value="06/12/2018"></ui5-calendar-date>
</ui5-calendar>
@ilhan007
Copy link
Member Author

ilhan007 commented Jan 8, 2021

Originated from: #1730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants