This repository was archived by the owner on Feb 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,15 @@ You can set date to be displayed by default with `date-set=""` attribute data (
104
104
</datepicker >
105
105
```
106
106
107
+ ####Default date not to be visible in input
108
+ You can set default date only to be set in calendar, not in input field. To be used with ` date-set="" ` option.
109
+
110
+ ``` html
111
+ <datepicker date-set =" 2018/07/14" hide-default-date =" true" >
112
+ <input ng-model =" date" type =" text" />
113
+ </datepicker >
114
+ ```
115
+
107
116
####Date disabled
108
117
You can disable specific dates using the ** date-disabled-dates=""** attribute and an _ Array_ of dates you want to disable.
109
118
Original file line number Diff line number Diff line change 19
19
'dateYearTitle' : '@' ,
20
20
'buttonNextTitle' : '@' ,
21
21
'buttonPrevTitle' : '@' ,
22
- 'dateDisabledDates' : '@'
22
+ 'dateDisabledDates' : '@' ,
23
+ 'hideDefaultDate' : '@'
23
24
} ,
24
25
'link' : function linkingFunction ( $scope , element , attr ) {
25
26
//get child input
112
113
$scope . monthNumber = Number ( $filter ( 'date' ) ( date , 'MM' ) ) ; // 01-12 like
113
114
$scope . day = Number ( $filter ( 'date' ) ( date , 'dd' ) ) ; //01-31 like
114
115
$scope . year = Number ( $filter ( 'date' ) ( date , 'yyyy' ) ) ; //2014 like
115
- $scope . setDaysInMonth ( $scope . monthNumber , $scope . year ) ;
116
- $scope . setInputValue ( ) ;
116
+ $scope . setDaysInMonth ( $scope . monthNumber , $scope . year ) ;
117
+ if ( $scope . hideDefaultDate !== 'true' ) {
118
+ $scope . setInputValue ( ) ;
119
+ }
117
120
}
118
121
} ) ;
119
122
You can’t perform that action at this time.
0 commit comments