|
52 | 52 | '</div>',
|
53 | 53 | '<div class="_720kb-datepicker-calendar-header-middle _720kb-datepicker-calendar-month">',
|
54 | 54 | '{{month}} ',
|
55 |
| - '<a href="javascript:void(0)" ng-click="showYearsPagination = !showYearsPagination">', |
| 55 | + '<a href="javascript:void(0)" ng-click="paginateYears(year); showYearsPagination = !showYearsPagination;">', |
56 | 56 | '<span>',
|
57 | 57 | '{{year}}',
|
58 | 58 | '<i ng-class="{\'_720kb-datepicker-calendar-header-closed-pagination\': !showYearsPagination, \'_720kb-datepicker-calendar-header-opened-pagination\': showYearsPagination}"></i>',
|
|
446 | 446 |
|
447 | 447 | $scope.day = Number(day);
|
448 | 448 | setInputValue();
|
449 |
| - |
| 449 | + |
450 | 450 | if (attr.hasOwnProperty('dateRefocus')) {
|
451 | 451 | thisInput[0].focus();
|
452 | 452 | }
|
453 |
| - |
| 453 | + |
454 | 454 | $scope.hideCalendar();
|
455 | 455 | }
|
456 | 456 | };
|
|
483 | 483 |
|
484 | 484 | theNewYears.push(Number(startingYear) + i);
|
485 | 485 | }
|
| 486 | + //date typing in input date-typer |
| 487 | + if ($scope.dateTyper === 'true') { |
| 488 | + |
| 489 | + thisInput.on('keyup blur', function onTyping() { |
| 490 | + |
| 491 | + if (thisInput[0].value && |
| 492 | + thisInput[0].value.length && |
| 493 | + thisInput[0].value.length > 0) { |
| 494 | + |
| 495 | + try { |
| 496 | + |
| 497 | + date = new Date(thisInput[0].value.toString()); |
| 498 | + |
| 499 | + if (date.getFullYear() && |
| 500 | + date.getDay() && |
| 501 | + date.getMonth() && |
| 502 | + $scope.isSelectableDate(date) && |
| 503 | + $scope.isSelectableMaxDate(date) && |
| 504 | + $scope.isSelectableMinDate(date)) { |
486 | 505 |
|
| 506 | + $scope.$apply(function applyTyping() { |
| 507 | + |
| 508 | + $scope.month = $filter('date')(date, 'MMMM');//december-November like |
| 509 | + $scope.monthNumber = Number($filter('date')(date, 'MM')); // 01-12 like |
| 510 | + |
| 511 | + if (date.getFullYear().toString().length === 4) { |
| 512 | + $scope.year = Number($filter('date')(date, 'yyyy'));//2014 like |
| 513 | + } |
| 514 | + setDaysInMonth($scope.monthNumber, $scope.year); |
| 515 | + $scope.day = Number($filter('date')(date, 'dd')); //01-31 like |
| 516 | + }); |
| 517 | + } |
| 518 | + } catch (e) { |
| 519 | + |
| 520 | + return e; |
| 521 | + } |
| 522 | + } |
| 523 | + }); |
| 524 | + } |
487 | 525 | //check range dates
|
488 | 526 | if ($scope.dateMaxLimit &&
|
489 | 527 | theNewYears &&
|
|
674 | 712 | 'buttonNextTitle': '@',
|
675 | 713 | 'buttonPrevTitle': '@',
|
676 | 714 | 'dateDisabledDates': '@',
|
677 |
| - 'dateSetHidden': '@' |
| 715 | + 'dateSetHidden': '@', |
| 716 | + 'dateTyper': '@' |
678 | 717 | },
|
679 | 718 | 'link': linkingFunction
|
680 | 719 | };
|
|
0 commit comments