diff --git a/src/directives/mwlCalendarHourList.js b/src/directives/mwlCalendarHourList.js index 94815c4f..807a74e1 100644 --- a/src/directives/mwlCalendarHourList.js +++ b/src/directives/mwlCalendarHourList.js @@ -74,11 +74,15 @@ angular return moment(baseDate).clone().add(minutes, 'minutes').add(days || 0, 'days').toDate(); }; - vm.onDragSelectStart = function(date) { - vm.dateRangeSelect = { - startDate: date, - endDate: date - }; + vm.onDragSelectStart = function(date, dayIndex) { + if (!vm.dateRangeSelect) { + vm.dateRangeSelect = { + active: true, + startDate: date, + endDate: date, + dayIndex: dayIndex + }; + } }; vm.onDragSelectMove = function(date) { diff --git a/src/directives/mwlCalendarWeek.js b/src/directives/mwlCalendarWeek.js index 315bf847..9a187f74 100644 --- a/src/directives/mwlCalendarWeek.js +++ b/src/directives/mwlCalendarWeek.js @@ -95,7 +95,8 @@ angular dayViewEnd: '=', dayViewSplit: '=', dayViewEventChunkSize: '=', - onTimespanClick: '=' + onTimespanClick: '=', + onDateRangeSelect: '=' }, controller: 'MwlCalendarWeekCtrl as vm', link: function(scope, element, attrs, calendarCtrl) { diff --git a/src/templates/calendar.html b/src/templates/calendar.html index a77cb2bc..0b2c25b5 100644 --- a/src/templates/calendar.html +++ b/src/templates/calendar.html @@ -49,6 +49,7 @@ day-view-split="vm.dayViewSplit" day-view-event-chunk-size="vm.dayViewEventChunkSize" on-timespan-click="vm.onTimespanClick" + on-date-range-select="vm.onDateRangeSelect" ng-switch-when="week"> diff --git a/src/templates/calendarHourList.html b/src/templates/calendarHourList.html index a65f85d7..90076eed 100644 --- a/src/templates/calendarHourList.html +++ b/src/templates/calendarHourList.html @@ -27,14 +27,22 @@ ng-if="vm.dayWidth">