spongessuck / gm.datepickerMultiSelect

AngularJS module to extend UI Bootstrap's Datepicker directive to allow for multiple date selections.
MIT License
73 stars 41 forks source link

affects highlight of days which are not mutli-select #22

Closed waratah closed 9 years ago

waratah commented 9 years ago

I had to apply this fix which 'work for me', checking whether I have a selected dates before affecting day.selected. Needs validation.

                function update() {
                   if (selectedDates.length) {
                        angular.forEach(scope.rows, function(row) {
                            angular.forEach(row, function(day) {
                                day.selected = selectedDates.indexOf(day.date.setHours(0, 0, 0, 0)) > -1
                            });
                        });
                   }
                }
spongessuck commented 9 years ago

Hi, what issue did you need this fix to solve?

waratah commented 9 years ago

If you do not install the extension the date selected in code is highlighted with btn-info (blue) after installing the extension the same date picker will display the dates without btn-info (grey). This will reset when you have two pickers showing, the second will start displaying blue when you click on the first. We have original code doing range with two date pickers (start and end). Selecting a new date in start will immediately turn blue and the second picker selected will also turn blue.

If I block updating the 'selected' scope variable is blocked when there are no selected dates in the array the 'other' date pickers work correctly.