dp.timeRangeSelectedHandling = "Hold";
dp.timeRangeRightClickHandling = "ContextMenu";
dp.onTimeRangeSelected = function (args) {
timerangeContextMenu.show({ calendar: dp });
};
var timerangeContextMenu = new DayPilot.Menu({
items: [
{
text: "Add Reservation", onClick: function (args) {
var selectedRange = dp.multirange.get();
if (selectedRange.length > 0) {
var data = getSelectedDays(selectedRange);
addReservation(data);
}
dp.clearSelection();
}
},
{ text: "-" },
{
text: "Clear selection", onClick: function (args) {
dp.clearSelection();
}
}
]
});
This is effectively the code that is in now and when the dp.multirange.get() is called in a context menu initiated from a range selected with the mouse, there are no issues, but when the dp.multirange.get() is called in a context menu initiated from a range selected with touch, it returns a zero length array.