Skip to content
This repository was archived by the owner on Dec 26, 2019. It is now read-only.

Commit aa79f23

Browse files
authored
Merge pull request #94 from trestini/docs-review
Docs review
2 parents 650ec2e + 013d947 commit aa79f23

File tree

2 files changed

+84
-5
lines changed

2 files changed

+84
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
/libpeerconnection.log
1616
npm-debug.log
1717
testem.log
18+
19+
*.iml
20+
.idea/

README.md

Lines changed: 81 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ Use separate component for inline mode:
4545
{{bootstrap-datepicker-inline value=expiresAt}}
4646
```
4747

48-
The component supports many options of the bootstrap-datepicker library. Let me show you how to use them :sparkles:
48+
The component supports many options of the bootstrap-datepicker library. Feel free to take a look into
49+
[bootstrap-datepicker docs on Read the Docs](https://bootstrap-datepicker.readthedocs.io/en/latest/) for more
50+
in-depth information.
51+
52+
Let me show you how to use them :sparkles:
4953

5054
### Available options
5155

5256
#### autoclose
5357

58+
Whether or not to close the datepicker immediately when a date is selected.
59+
5460
Type: `Boolean`
5561
Default: `false`
5662

@@ -60,6 +66,8 @@ Default: `false`
6066

6167
#### calendarWeeks
6268

69+
Whether or not to show week numbers to the left of week rows.
70+
6371
Type: `Boolean`
6472
Default: `false`
6573

@@ -69,15 +77,32 @@ Default: `false`
6977

7078
#### clearBtn
7179

80+
If true, displays a “Clear” button at the bottom of the datepicker to clear the input value. If “autoclose” is also
81+
set to true, this button will also close the datepicker.
82+
7283
Type: `Boolean`
7384
Default: `false`
7485

7586
```handlebars
7687
{{bootstrap-datepicker value=expiresAt clearBtn=true}}
7788
```
7889

90+
#### datesDisabled
91+
92+
Array of date strings or a single date string formatted in the given date format
93+
94+
Type: `Array` or `String`
95+
Default: `""` or `[]`
96+
97+
```handlebars
98+
{{bootstrap-datepicker value=expiresAt datesDisabled="1,14"}}
99+
```
100+
79101
#### daysOfWeekDisabled
80102

103+
Days of the week that should be disabled. Values are 0 (Sunday) to 6 (Saturday). Multiple values should be
104+
comma-separated. Example: disable weekends: `'06'` or `'0,6'` or `[0,6]`.
105+
81106
Type: `Array` or `String`
82107
Default: `""` or `[]`
83108

@@ -87,6 +112,8 @@ Default: `""` or `[]`
87112

88113
#### endDate
89114

115+
The latest date that may be selected; all later dates will be disabled.
116+
90117
Type: `Date` or `String`
91118
Default: `Infinity` (end of time)
92119

@@ -96,6 +123,10 @@ Default: `Infinity` (end of time)
96123

97124
#### forceParse
98125

126+
Whether or not to force parsing of the input value when the picker is closed. That is, when an invalid date
127+
is left in the input field by the user, the picker will forcibly parse that value, and set the input’s value
128+
to the new, valid date, conforming to the given format.
129+
99130
Type: `Boolean`
100131
Default: `true`
101132

@@ -105,6 +136,14 @@ Default: `true`
105136

106137
#### format
107138

139+
The date format, combination of d, dd, D, DD, m, mm, M, MM, yy, yyyy.
140+
141+
* d, dd: Numeric date, no leading zero and leading zero, respectively. Eg, 5, 05.
142+
* D, DD: Abbreviated and full weekday names, respectively. Eg, Mon, Monday.
143+
* m, mm: Numeric month, no leading zero and leading zero, respectively. Eg, 7, 07.
144+
* M, MM: Abbreviated and full month names, respectively. Eg, Jan, January
145+
* yy, yyyy: 2- and 4-digit years, respectively. Eg, 12, 2012.
146+
108147
Type: `String`
109148
Default: `'mm/dd/yyyy'`
110149

@@ -114,6 +153,8 @@ Default: `'mm/dd/yyyy'`
114153

115154
#### keyboardNavigation
116155

156+
Whether or not to allow date navigation by arrow keys.
157+
117158
Type: `Boolean`
118159
Default: `true`
119160

@@ -123,22 +164,34 @@ Default: `true`
123164

124165
#### language
125166

126-
Type: `String`
127-
Default: `'en'`
167+
The IETF code (eg “en” for English, “pt-BR” for Brazilian Portuguese) of the language to use for month and day
168+
names. These will also be used as the input’s value (and subsequently sent to the server in the case of form
169+
submissions). If a full code (eg “de-DE”) is supplied the picker will first check for an “de-DE” language and
170+
if not found will fallback and check for a “de” language. If an unknown language code is given, English will
171+
be used.
128172

129173
When you need another language, you should import a locale file using your Brocfile.js. Just import `bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.<LANGUAGE_CODE>.js`, e.g.:
130174

131175
```javascript
132176
// Brocfile.js
133177
app.import('bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.de.js');
134178
```
179+
180+
Type: `String`
181+
Default: `'en'`
182+
135183
```handlebars
136184
{{! somewhere in template }}
137185
{{bootstrap-datepicker value=expiresAt language="de"}}
138186
```
139187

140188
#### minViewMode
141189

190+
Set a minimum limit for the view mode. Accepts: “days” or 0, “months” or 1, “years” or 2, “decades” or 3, and
191+
“centuries” or 4. Gives the ability to pick only a month, a year or a decade. The day is set to the 1st for “months”,
192+
and the month is set to January for “years”, the year is set to the first year from the decade for “decades”, and
193+
the year is set to the first from the millennium for “centuries”.
194+
142195
Type: `Number` or `String`
143196
Default: `0` or `'days'`
144197

@@ -148,6 +201,17 @@ Default: `0` or `'days'`
148201

149202
#### orientation
150203

204+
A space-separated string consisting of one or two of “left” or “right”, “top” or “bottom”, and “auto” (may be
205+
omitted); for example, “top left”, “bottom” (horizontal orientation will default to “auto”), “right” (vertical
206+
orientation will default to “auto”), “auto top”. Allows for fixed placement of the picker popup.
207+
208+
“orientation” refers to the location of the picker popup’s “anchor”; you can also think of it as the location of
209+
the trigger element (input, component, etc) relative to the picker.
210+
211+
“auto” triggers “smart orientation” of the picker. Horizontal orientation will default to “left” and left offset
212+
will be tweaked to keep the picker inside the browser viewport; vertical orientation will simply choose “top” or
213+
“bottom”, whichever will show more of the picker in the viewport.
214+
151215
Type: `String`
152216
Default: `'auto'`
153217

@@ -157,6 +221,8 @@ Default: `'auto'`
157221

158222
#### startDate
159223

224+
The earliest date that may be selected; all earlier dates will be disabled.
225+
160226
Type: `Date` or `String`
161227
Default: `-Infinity` (beginning of time)
162228

@@ -166,6 +232,10 @@ Default: `-Infinity` (beginning of time)
166232

167233
#### startView
168234

235+
The view that the datepicker should show when it is opened. Accepts values of 0 or “month” for month view (the
236+
default), 1 or “year” for the 12-month overview, 2 or “decade” for the 10-year overview, 3 or “century” for the
237+
10-decade overview, and 4 or “millennium” for the 10-century overview. Useful for date-of-birth datepickers.
238+
169239
Type: `Number` or `String`
170240
Default: `0` or `'month'`
171241

@@ -175,17 +245,21 @@ Default: `0` or `'month'`
175245

176246
#### todayBtn
177247

248+
If true or “linked”, displays a “Today” button at the bottom of the datepicker to select the current date.
249+
If true, the “Today” button will only move the current date into view; if “linked”, the current date will
250+
also be selected.
251+
178252
Type: `Boolean` or `String`
179253
Default: `false`
180254

181-
> If true or “linked”, displays a “Today” button at the bottom of the datepicker to select the current date. If true, the “Today” button will only move the current date into view; if “linked”, the current date will also be selected. [More...](http://bootstrap-datepicker.readthedocs.org/en/latest/options.html#todaybtn)
182-
183255
```handlebars
184256
{{bootstrap-datepicker value=expiresAt todayBtn=true}}
185257
```
186258

187259
#### todayHighlight
188260

261+
If true, highlights the current date.
262+
189263
Type: `Boolean`
190264
Default: `false`
191265

@@ -195,6 +269,8 @@ Default: `false`
195269

196270
#### weekStart
197271

272+
Day of the week start. 0 (Sunday) to 6 (Saturday)
273+
198274
Type: `Number`
199275
Default: `0` (Sunday)
200276

0 commit comments

Comments
 (0)