|
1 | 1 | /** |
2 | | -* @version: 1.3.16 |
| 2 | +* @version: 1.3.17 |
3 | 3 | * @author: Dan Grossman http://www.dangrossman.info/ |
4 | | -* @date: 2014-11-12 |
| 4 | +* @date: 2014-11-25 |
5 | 5 | * @copyright: Copyright (c) 2012-2014 Dan Grossman. All rights reserved. |
6 | | -* @license: Licensed under Apache License v2.0. See http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php |
7 | 7 | * @website: http://www.improvely.com/ |
8 | 8 | */ |
9 | 9 |
|
|
304 | 304 | //if no start/end dates set, check if an input element contains initial values |
305 | 305 | if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { |
306 | 306 | if ($(this.element).is('input[type=text]')) { |
307 | | - var val = $(this.element).val(), |
| 307 | + var val = $(this.element).val(), |
308 | 308 | split = val.split(this.separator); |
309 | | - |
| 309 | + |
310 | 310 | start = end = null; |
311 | | - |
| 311 | + |
312 | 312 | if (split.length == 2) { |
313 | 313 | start = moment(split[0], this.format); |
314 | 314 | end = moment(split[1], this.format); |
|
604 | 604 | // Bind global datepicker mousedown for hiding and |
605 | 605 | $(document) |
606 | 606 | .on('mousedown.daterangepicker', this._outsideClickProxy) |
| 607 | + // also support mobile devices |
| 608 | + .on('touchend.daterangepicker', this._outsideClickProxy) |
607 | 609 | // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them |
608 | 610 | .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy) |
609 | 611 | // and also close when focus changes to outside the picker (eg. tabbing between controls) |
|
618 | 620 | // if the page is clicked anywhere except within the daterangerpicker/button |
619 | 621 | // itself then call this.hide() |
620 | 622 | if ( |
| 623 | + // ie modal dialog fix |
| 624 | + e.type == "focusin" || |
621 | 625 | target.closest(this.element).length || |
622 | 626 | target.closest(this.container).length || |
623 | 627 | target.closest('.calendar-date').length |
|
765 | 769 | if (startDate.isAfter(endDate)) { |
766 | 770 | var difference = this.endDate.diff(this.startDate); |
767 | 771 | endDate = moment(startDate).add(difference, 'ms'); |
| 772 | + if (this.maxDate && endDate.isAfter(this.maxDate)) { |
| 773 | + endDate = this.maxDate; |
| 774 | + } |
768 | 775 | } |
769 | 776 | this.startDate = startDate; |
770 | 777 | this.endDate = endDate; |
|
1023 | 1030 | html += '<th></th>'; |
1024 | 1031 |
|
1025 | 1032 | if (!minDate || minDate.isBefore(calendar.firstDay)) { |
1026 | | - html += '<th class="prev available"><i class="fa fa-arrow-left icon-arrow-left glyphicon glyphicon-arrow-left"></i></th>'; |
| 1033 | + html += '<th class="prev available"><i class="fa fa-arrow-left icon icon-arrow-left glyphicon glyphicon-arrow-left"></i></th>'; |
1027 | 1034 | } else { |
1028 | 1035 | html += '<th></th>'; |
1029 | 1036 | } |
|
1036 | 1043 |
|
1037 | 1044 | html += '<th colspan="5" class="month">' + dateHtml + '</th>'; |
1038 | 1045 | if (!maxDate || maxDate.isAfter(calendar.lastDay)) { |
1039 | | - html += '<th class="next available"><i class="fa fa-arrow-right icon-arrow-right glyphicon glyphicon-arrow-right"></i></th>'; |
| 1046 | + html += '<th class="next available"><i class="fa fa-arrow-right icon icon-arrow-right glyphicon glyphicon-arrow-right"></i></th>'; |
1040 | 1047 | } else { |
1041 | 1048 | html += '<th></th>'; |
1042 | 1049 | } |
|
0 commit comments