Skip to content

Commit

Permalink
update usages of datepicker toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Jun 22, 2017
1 parent c0a4c71 commit 094020f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/lib/datepicker/datepicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ An optional datepicker toggle button is available. A toggle can be added to the

```html
<input [mdDatepicker]="myDatepicker">
<button [mdDatepickerToggle]="myDatepicker"></button>
<button md-icon-button [mdDatepickerToggle]="myDatepicker">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
<md-datepicker #myDatepicker></md-datepicker>
```

Expand All @@ -35,7 +37,9 @@ can easily be used as a prefix or suffix on the material input:
```html
<md-input-container>
<input mdInput [mdDatepicker]="myDatepicker">
<button mdSuffix [mdDatepickerToggle]="myDatepicker"></button>
<button md-icon-button mdSuffix [mdDatepickerToggle]="myDatepicker">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
</md-input-container>
<md-datepicker #myDatepicker></md-datepicker>
```
Expand Down
12 changes: 9 additions & 3 deletions src/lib/datepicker/datepicker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,9 @@ class DatepickerWithFormControl {
@Component({
template: `
<input [mdDatepicker]="d">
<button [mdDatepickerToggle]="d"></button>
<button [mdDatepickerToggle]="d">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
<md-datepicker #d [touchUi]="touchUI"></md-datepicker>
`,
})
Expand All @@ -839,7 +841,9 @@ class InputContainerDatepicker {
@Component({
template: `
<input [mdDatepicker]="d" [(ngModel)]="date" [min]="minDate" [max]="maxDate">
<button [mdDatepickerToggle]="d"></button>
<button [mdDatepickerToggle]="d">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
<md-datepicker #d></md-datepicker>
`,
})
Expand All @@ -854,7 +858,9 @@ class DatepickerWithMinAndMaxValidation {
@Component({
template: `
<input [mdDatepicker]="d" [(ngModel)]="date" [mdDatepickerFilter]="filter">
<button [mdDatepickerToggle]="d"></button>
<button [mdDatepickerToggle]="d">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
<md-datepicker #d [touchUi]="true"></md-datepicker>
`,
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<md-input-container>
<input mdInput [mdDatepicker]="picker" placeholder="Choose a date">
<button mdSuffix [mdDatepickerToggle]="picker"></button>
<button md-icon-button mdSuffix [mdDatepickerToggle]="picker">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
</md-input-container>
<md-datepicker #picker></md-datepicker>
4 changes: 3 additions & 1 deletion src/universal-app/kitchen-sink/kitchen-sink.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ <h2>Datepicker</h2>

<md-input-container>
<input type="text" mdInput [mdDatepicker]="birthday" placeholder="Birthday">
<button mdSuffix [mdDatepickerToggle]="birthday"></button>
<button md-icon-button mdSuffix [mdDatepickerToggle]="birthday">
<md-datepicker-toggle-icon></md-datepicker-toggle-icon>
</button>
<md-datepicker #birthday></md-datepicker>
</md-input-container>

Expand Down

0 comments on commit 094020f

Please sign in to comment.