Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit e42ec3e

Browse files
committed
Updated README.md
1 parent 4cee758 commit e42ec3e

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,38 @@ Sometimes you cannot put date input as a first child of datepicker. In this case
146146
</div>
147147
</datepicker>
148148
```
149-
####Datepicker always visible
150-
Sometimes you would set the datepicker always visible in page.
151-
To achieve this, you just have to use this CSS line:
152-
153-
```css
154-
._720kb-datepicker-calendar{
155-
visibility:visible;
156-
}
149+
####Datepicker manually show and hide
150+
Sometimes you would to manually show or hide the datepicker, this can be achieved using `datepicker-show` attribute, if `false`, datepicker is hidden, if `true`, datepicker is shown
151+
152+
```javascript
153+
.controller('TestController', ['$scope', '$interval', function TestController($scope, $interval) {
154+
$scope.visibility = true;
155+
156+
$interval(function setInterval() {
157+
//toggling manually everytime
158+
$scope.visibility = !$scope.visibility;
159+
}, 3500);
160+
}]);
161+
```
162+
```html
163+
<datepicker ng-controller="TestController" datepicker-show="{{visibility}}">
164+
<input ng-model="date3" type="text" class="angular-datepicker-input"/>
165+
</datepicker>
166+
```
167+
_tip: you should use this attribute togheter with `datepicker-toggle="false" , for a better stable behavior of the datepicker_
168+
169+
####Input as grandchild
170+
Sometimes you cannot put date input as a first child of datepicker. In this case you may use `selector=""` to point to the CSS class of the input. Below example with using Twitter Bootstrap and FontAwesome
171+
172+
```html
173+
<datepicker date-format="yyyy-MM-dd" selector="form-control">
174+
<div class="input-group">
175+
<input class="form-control" placeholder="Choose a date"/>
176+
<span class="input-group-addon" style="cursor: pointer">
177+
<i class="fa fa-lg fa-calendar"></i>
178+
</span>
179+
</div>
180+
</datepicker>
157181
```
158182
###Tips
159183

0 commit comments

Comments
 (0)