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
Everyone loves a nice date picker - now you can have your very own date picker in Schema Form! The date picker add-on uses the excellent jQuery-based date picker, [pickadate.js](http://amsul.ca/pickadate.js/).
7
5
8
-
Note that dates in JSON Schema has the type *"string"* and follow the *RFC 3339*
9
-
date fomat which in turn follows *ISO 8601*. So what does that really mean? Stick
10
-
with the format ```yyyy-mm-dd``` and you'll be fine. The date picker only
11
-
supports date, not time.
6
+
Dates in JSON Schema are of type *"string"* and follow the *RFC 3339* date fomat, which, in turn, follows *ISO 8601*. What does that mean for you? Basically, just stick with the format `yyyy-mm-dd` and you'll be fine.
7
+
8
+
Within Schema Form, pickadate only supports dates - not times.
12
9
13
10
Installation
14
11
------------
15
-
The date picker is an addon to the bootstrap decorator. To use it you just
16
-
include ```dist/bootstrap-datepicker.min.js```*after*
17
-
```dist/bootstrap-decorator.min.js```
18
-
19
-
You'll also need the files neccessary for pickadate, see the pickadate.js
20
-
[github page](https://github.com/amsul/pickadate.js) or documentation.
21
-
22
-
Note that it depends on jQuery and that you also need CSS and translation files
23
-
for the language you like to use.
12
+
The date picker is an add-on to the Bootstrap decorator. To use it, just include `dist/bootstrap-datepicker.min.js`*after*`dist/bootstrap-decorator.min.js`.
24
13
14
+
You'll need to load a few additional files to use pickadate:
25
15
16
+
1. jQuery (pickadate depends on it)
17
+
2. The pickadate source files (see the pickadate.js [GitHub page](https://github.com/amsul/pickadate.js) for documentation)
18
+
3. The pickadate CSS
19
+
4. Translation files for whatever language you want to use
26
20
27
21
Usage
28
22
-----
29
-
The datepicker addon adds a new form type```datepicker``` and a new default
23
+
The datepicker add-on adds a new form type, `datepicker`, and a new default
30
24
mapping.
31
25
32
26
| Form Type | Becomes |
33
27
|:---------------|:------------:|
34
-
| datepicker | a pick a date widget |
28
+
| datepicker | a pickadate widget |
35
29
36
30
37
-
| Schema | Form type |
31
+
| Schema |Default Form type |
38
32
|:-------------------|:------------:|
39
33
| "type": "string" and "format": "date" | datepicker |
40
34
41
35
42
-
Options
36
+
Form Type Options
43
37
-------
38
+
The `datepicker` form type takes two options: `minDate` and `maxDate`. `minDate` and `maxDate` both accept one of the following as values:
39
+
40
+
1. A string in the format `yyyy-mm-dd`,
41
+
2. A unix timestamp (as a Number), or
42
+
3. An instance of `Date`
43
+
44
+
Here's an example:
45
+
44
46
```javascript
45
47
{
46
48
key:"birthDate",
@@ -49,6 +51,4 @@ Options
49
51
}
50
52
```
51
53
52
-
The ```datepicker``` takes two options, a max and min date. Both take either
53
-
a string in the format ```yyyy-mm-dd```, a unix timestamp (as a Number) or a
0 commit comments