You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 26, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+72-5Lines changed: 72 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,12 +45,18 @@ Use separate component for inline mode:
45
45
{{bootstrap-datepicker-inline value=expiresAt}}
46
46
```
47
47
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:
49
53
50
54
### Available options
51
55
52
56
#### autoclose
53
57
58
+
Whether or not to close the datepicker immediately when a date is selected.
59
+
54
60
Type: `Boolean`
55
61
Default: `false`
56
62
@@ -60,6 +66,8 @@ Default: `false`
60
66
61
67
#### calendarWeeks
62
68
69
+
Whether or not to show week numbers to the left of week rows.
70
+
63
71
Type: `Boolean`
64
72
Default: `false`
65
73
@@ -69,6 +77,9 @@ Default: `false`
69
77
70
78
#### clearBtn
71
79
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
+
72
83
Type: `Boolean`
73
84
Default: `false`
74
85
@@ -78,6 +89,8 @@ Default: `false`
78
89
79
90
#### datesDisabled
80
91
92
+
Array of date strings or a single date string formatted in the given date format
93
+
81
94
Type: `Array` or `String`
82
95
Default: `""` or `[]`
83
96
@@ -87,6 +100,9 @@ Default: `""` or `[]`
87
100
88
101
#### daysOfWeekDisabled
89
102
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
+
90
106
Type: `Array` or `String`
91
107
Default: `""` or `[]`
92
108
@@ -96,6 +112,8 @@ Default: `""` or `[]`
96
112
97
113
#### endDate
98
114
115
+
The latest date that may be selected; all later dates will be disabled.
116
+
99
117
Type: `Date` or `String`
100
118
Default: `Infinity` (end of time)
101
119
@@ -105,6 +123,10 @@ Default: `Infinity` (end of time)
105
123
106
124
#### forceParse
107
125
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
+
108
130
Type: `Boolean`
109
131
Default: `true`
110
132
@@ -114,6 +136,14 @@ Default: `true`
114
136
115
137
#### format
116
138
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
+
117
147
Type: `String`
118
148
Default: `'mm/dd/yyyy'`
119
149
@@ -123,6 +153,8 @@ Default: `'mm/dd/yyyy'`
123
153
124
154
#### keyboardNavigation
125
155
156
+
Whether or not to allow date navigation by arrow keys.
157
+
126
158
Type: `Boolean`
127
159
Default: `true`
128
160
@@ -132,22 +164,34 @@ Default: `true`
132
164
133
165
#### language
134
166
135
-
Type: `String`
136
-
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.
137
172
138
173
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.:
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
+
151
195
Type: `Number` or `String`
152
196
Default: `0` or `'days'`
153
197
@@ -157,6 +201,17 @@ Default: `0` or `'days'`
157
201
158
202
#### orientation
159
203
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
+
160
215
Type: `String`
161
216
Default: `'auto'`
162
217
@@ -166,6 +221,8 @@ Default: `'auto'`
166
221
167
222
#### startDate
168
223
224
+
The earliest date that may be selected; all earlier dates will be disabled.
225
+
169
226
Type: `Date` or `String`
170
227
Default: `-Infinity` (beginning of time)
171
228
@@ -175,6 +232,10 @@ Default: `-Infinity` (beginning of time)
175
232
176
233
#### startView
177
234
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
+
178
239
Type: `Number` or `String`
179
240
Default: `0` or `'month'`
180
241
@@ -184,17 +245,21 @@ Default: `0` or `'month'`
184
245
185
246
#### todayBtn
186
247
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
+
187
252
Type: `Boolean` or `String`
188
253
Default: `false`
189
254
190
-
> 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)
0 commit comments