| | |
| | | options.monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; |
| | | break; |
| | | } |
| | | |
| | | if (angular.isDefined($attrs["rangeType"])) { |
| | | $($element).daterangepicker({ |
| | | timePicker: false, |
| | | autoUpdateInput: true, |
| | | autoApply : true, |
| | | minDate : minDate, |
| | | maxDate : maxDate, |
| | | parentEl : $scope.parentEl !== undefined ? $scope.parentEl : "body", |
| | | locale: { |
| | | format: 'YYYY-MM-DD', |
| | | separator: " ~ ", |
| | | applyLabel: options.applyLabel, |
| | | cancelLabel: options.cancelLabel, |
| | | daysOfWeek: options.daysOfWeek, |
| | | monthNames: options.monthNames |
| | | }, |
| | | opens : "center" |
| | | }); |
| | | if ($attrs["rangeType"] === "date") |
| | | { |
| | | $($element).daterangepicker({ |
| | | timePicker: false, |
| | | autoUpdateInput: true, |
| | | autoApply: true, |
| | | minDate: minDate, |
| | | maxDate: maxDate, |
| | | parentEl: $scope.parentEl !== undefined ? $scope.parentEl : "body", |
| | | locale: { |
| | | format: 'YYYY-MM-DD', |
| | | separator: " ~ ", |
| | | applyLabel: options.applyLabel, |
| | | cancelLabel: options.cancelLabel, |
| | | daysOfWeek: options.daysOfWeek, |
| | | monthNames: options.monthNames |
| | | }, |
| | | opens: "center" |
| | | }); |
| | | } else if ($attrs["rangeType"] === "singleDate") { |
| | | $($element).daterangepicker({ |
| | | timePicker: true, |
| | | timePickerSeconds : true, |
| | | autoUpdateInput: true, |
| | | autoApply : true, |
| | | singleDatePicker : true, |
| | | isSingle : true, |
| | | |
| | | //parentEl : $scope.parentEl !== undefined ? $scope.parentEl : "", |
| | | locale: { |
| | | format: 'YYYY-MM-DD/hh-mm-ss A', |
| | | applyLabel: options.applyLabel, |
| | | cancelLabel: options.cancelLabel, |
| | | daysOfWeek: options.daysOfWeek, |
| | | monthNames: options.monthNames |
| | | }, |
| | | opens : "center" |
| | | }); |
| | | // singleDate 취소 버튼 (값 초기화) |
| | | $($element).on('cancel.daterangepicker', function(ev, picker) { |
| | | $scope.ngModel = ""; |
| | | }); |
| | | } |
| | | } |
| | | else { |
| | | $($element).daterangepicker({ |