Skip to content
This repository was archived by the owner on Jan 22, 2018. It is now read-only.

Commit 3a0ed55

Browse files
author
Kamil Kisiela
committed
Add datepicker documentation
1 parent 6c03976 commit 3a0ed55

File tree

1 file changed

+42
-8
lines changed

1 file changed

+42
-8
lines changed

README.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@ Any requests? Add issue!
3434

3535
### theme (string)
3636

37-
```
3837
md-theme attribute
39-
```
4038

4139
## Fields
4240

4341
### input
4442

45-
```json
43+
```javascript
4644
{
4745
"type": "input",
4846
"key": "firstName",
@@ -58,7 +56,7 @@ md-theme attribute
5856

5957
**rows (number, optional)**
6058

61-
```json
59+
```javascript
6260
{
6361
"type": "textarea",
6462
"key": "bio",
@@ -78,7 +76,7 @@ md-theme attribute
7876

7977
**valueProp (string, optional)**
8078

81-
```json
79+
```javascript
8280
{
8381
"type": "radio",
8482
"key": "name",
@@ -104,7 +102,7 @@ md-theme attribute
104102

105103
**valueProp (string, optional)**
106104

107-
```json
105+
```javascript
108106
{
109107
"type": "select",
110108
"key": "name",
@@ -124,7 +122,7 @@ md-theme attribute
124122

125123
### checkbox
126124

127-
```json
125+
```javascript
128126
{
129127
"type": "checkbox",
130128
"key": "terms",
@@ -137,7 +135,7 @@ md-theme attribute
137135

138136
### switch
139137

140-
```json
138+
```javascript
141139
{
142140
"type": "switch",
143141
"key": "terms",
@@ -148,6 +146,42 @@ md-theme attribute
148146
}
149147
```
150148

149+
### datepicker
150+
151+
**placeholder (string, optional)**
152+
153+
md-placeholder
154+
155+
**minDate (Date, optional)**
156+
157+
md-min-date
158+
159+
**maxDate (Date, optional)**
160+
161+
md-max-date
162+
163+
**filterDate (function, optional)**
164+
165+
md-filter-date
166+
167+
```javascript
168+
{
169+
"type": "datepicker",
170+
"key": "start",
171+
"templateOptions": {
172+
"theme": "custom",
173+
"placeholder": "Start date",
174+
"minDate": minDate, // instance of Date
175+
"maxDate": maxDate, // instance of Date
176+
"filterDate": function(date) {
177+
// only weekends
178+
var day = date.getDay();
179+
return day === 0 || day === 6;
180+
}
181+
}
182+
}
183+
```
184+
151185
## Wrappers
152186

153187
- mdInputContainer

0 commit comments

Comments
 (0)