File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,20 @@ Prevents date/time selections before this date
147
147
148
148
149
149
150
+ #### openOnFocus
151
+
152
+ Default: ` false `
153
+
154
+ Accepts: ` boolean `
155
+
156
+ ``` handlebars
157
+ {{bs-datetimepicker date=myDate openOnFocus=true}}
158
+ ```
159
+
160
+ Opens the picker on input focus
161
+
162
+
163
+
150
164
#### showClear
151
165
152
166
Default: ` false `
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ export default Component.extend({
15
15
layout,
16
16
tagName : 'div' ,
17
17
classNames : [ 'input-group date' ] ,
18
+ placeholder : '' ,
19
+
20
+ openOnFocus : false ,
18
21
19
22
iconClasses : computed ( 'isTime' , function ( ) {
20
23
if ( this . get ( 'isTime' ) ) {
@@ -81,5 +84,13 @@ export default Component.extend({
81
84
this . removeObserver ( 'minDate' ) ;
82
85
83
86
this . $ ( ) . data ( 'DateTimePicker' ) . destroy ( ) ;
87
+ } ,
88
+
89
+ actions : {
90
+ focus ( ) {
91
+ if ( this . get ( 'openOnFocus' ) ) {
92
+ this . $ ( ) . data ( 'DateTimePicker' ) . show ( ) ;
93
+ }
94
+ }
84
95
}
85
96
} ) ;
Original file line number Diff line number Diff line change 1
- <input type =" text" class =" form-control" >
1
+ <input type =" text" class =" form-control" placeholder = {{ placeholder }} onfocus = {{ action ' focus ' }} >
2
2
<span class =" input-group-addon" >
3
3
<i class ={{ iconClasses }} ></i >
4
4
</span >
You can’t perform that action at this time.
0 commit comments