feat(ui5-calendar): Declarative dates support added #2648
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
ui5-date
with a singlevalue
property of typeString
(formatted date)ui5-calendar
has a new slot:dates
that accepts instances ofui5-date
selectedDates
property is removed fromui5-calendar
and replaced with a getter and setter which mimic the old behavior entirely.get selectedDates
returns an array of UTC timestamps andset selectedDates
allows to pass such an array and build the dates as children of the calendar itself. This can be used as a utility and is used internally.selected-dates-change
event in order to prevent the default behavior of theui5-calendar
creating instances ofui5-date
inside itself.ui5-date-picker
,ui5-daterange-picker
andui5-datetime-picker
components have been slightly reworked to use the new API ofui5-calendar
(although they would have worked with the compatibility getter/setter too).BREAKING CHANGE:
selectedDates
is deprecated forui5-calendar
. Instead of settingselectedDates
as an array of UTC timestamps, please provide instances ofui5-date
as children of theui5-calendar
. Instead of reading theselectedDates
property to find out which dates the user selected, please read the children of theui5-calendar
(instances ofui5-date
withvalue
property).Important: for backward compatibility there are the
get selectedDates
andset selectedDates
getter and setter methods that mimic the old behavior entirely so your code can continue to work.closes: #2528