I tried to bind an array of dates to sap.ui.unified.Calendar but without success. I am sure I am not far from the solution.
Here is the code:
var oCal = new sap.ui.unified.Calendar();
var oModel2 = new sap.ui.model.json.JSONModel([
{myDate: new Date("2018-01-10"), tt:""},
{myDate: new Date("2018-01-11"), tt:""},
{myDate: new Date("2018-01-12"), tt:""},
]);
sap.ui.getCore().setModel(oModel, "MyData3");
var oItemTemplate = new sap.ui.unified.DateRange({
startDate: "{MyData3>myDate}",
endDate: "{MyData3>myDate}"
});
oCal.bindAggregation("selectedDates", "MyData3>/", oItemTemplate);
I don't get any exception. The model has the data filled with 3 objects of type Date but I do not have those 3 dates pre-selected in the calendar.
If I fill the selectedDates
aggregation manually (without binding) it will select those 3 dates.