@@ -5,34 +5,34 @@ dateinterval Field Type
5
5
=======================
6
6
7
7
This field type allows the user to modify data that represents a specific
8
- interval (e.g. `` P7Y6M5DT12H15M30S ``) .
8
+ date interval. It can be rendered as a integer or text input or select tags .
9
9
10
- Can be rendered as a integer or text input or select tags. The underlying format of the
11
- data can be a `` DateInterval `` object, a ` RFC 3339 `_ duration string or an array.
10
+ The underlying format of the data can be a `` DateInterval `` object,
11
+ a `RFC 3339 `_ duration string (e.g. `` P1DT12H ``) or an array.
12
12
13
13
+----------------------+-----------------------------------------------------------------------------------+
14
14
| Underlying Data Type | can be ``DateInterval ``, string or array (see the ``input `` option) |
15
15
+----------------------+-----------------------------------------------------------------------------------+
16
16
| Rendered as | single text box or up to six select, text or integer boxes plus optional checkbox |
17
17
+----------------------+-----------------------------------------------------------------------------------+
18
- | Options | - `with_years `_ |
19
- | | - `with_months `_ |
20
- | | - `with_weeks `_ |
18
+ | Options | - `days `_ |
19
+ | | - `placeholder `_ |
20
+ | | - `hours `_ |
21
+ | | - `input `_ |
22
+ | | - `minutes `_ |
23
+ | | - `months `_ |
24
+ | | - `seconds `_ |
25
+ | | - `weeks `_ |
26
+ | | - `widget `_ |
21
27
| | - `with_days `_ |
22
28
| | - `with_hours `_ |
29
+ | | - `with_invert `_ |
23
30
| | - `with_minutes `_ |
31
+ | | - `with_months `_ |
24
32
| | - `with_seconds `_ |
25
- | | - `with_invert `_ |
33
+ | | - `with_weeks `_ |
34
+ | | - `with_years `_ |
26
35
| | - `years `_ |
27
- | | - `months `_ |
28
- | | - `weeks `_ |
29
- | | - `days `_ |
30
- | | - `hours `_ |
31
- | | - `minutes `_ |
32
- | | - `seconds `_ |
33
- | | - `placeholder `_ |
34
- | | - `input `_ |
35
- | | - `widget `_ |
36
36
+----------------------+-----------------------------------------------------------------------------------+
37
37
| Inherited | - `data `_ |
38
38
| options | - `disabled `_ |
@@ -80,27 +80,15 @@ The field also supports an ``array`` as valid ``input`` option values.
80
80
Field Options
81
81
-------------
82
82
83
- input
84
- ~~~~~
85
-
86
- **type **: ``string `` **default **: ``dateinterval ``
87
-
88
- The format of the *input * data - i.e. the format that the interval is stored on
89
- your underlying object. Valid values are:
90
-
91
- * ``string `` (e.g. ``P1DT12H ``)
92
- * ``dateinterval `` (a ``DateInterval `` object)
93
- * ``array `` (e.g. ``array('days' => '1', 'hours' => '12',) ``)
94
-
95
- The value that comes back from the form will also be normalized back into
96
- this format.
83
+ days
84
+ ~~~~
97
85
98
- widget
99
- ~~~~~~
86
+ **type **: ``array `` **default **: 0 to 31
100
87
101
- **type **: ``string `` **default **: ``choice ``
88
+ List of days available to the days field type. This option is only relevant
89
+ when the ``widget `` option is set to ``choice ``::
102
90
103
- Defines the `` widget `` option for the single interval component inputs.
91
+ 'days' => range(1, 31)
104
92
105
93
placeholder
106
94
~~~~~~~~~~~
@@ -121,29 +109,77 @@ Alternatively, you can specify a string to be displayed for the "blank" value::
121
109
'placeholder' => array('years' => 'Years', 'months' => 'Months', 'days' => 'Days')
122
110
));
123
111
124
- with_years
125
- ~~~~~~~~~~
112
+ hours
113
+ ~~~~~
126
114
127
- **type **: ``Boolean `` **default **: `` true ``
115
+ **type **: ``array `` **default **: 0 to 24
128
116
129
- Whether or not to include years in the input . This will result in an additional
130
- input to capture years.
117
+ List of hours available to the hours field type . This option is only relevant
118
+ when the `` widget `` option is set to `` choice ``::
131
119
132
- with_months
133
- ~~~~~~~~~~~
120
+ 'hours' => range(1, 24)
134
121
135
- **type **: ``Boolean `` **default **: ``true ``
122
+ input
123
+ ~~~~~
136
124
137
- Whether or not to include months in the input. This will result in an additional
138
- input to capture months.
125
+ **type **: ``string `` **default **: ``dateinterval ``
139
126
140
- with_weeks
141
- ~~~~~~~~~~
127
+ The format of the * input * data - i.e. the format that the interval is stored on
128
+ your underlying object. Valid values are:
142
129
143
- **type **: ``Boolean `` **default **: ``false ``
130
+ * ``string `` (a string formatted with `RFC 3339 `_ standard, e.g. ``P7Y6M5DT12H15M30S ``)
131
+ * ``dateinterval `` (a ``DateInterval `` object)
132
+ * ``array `` (e.g. ``array('days' => '1', 'hours' => '12',) ``)
144
133
145
- Whether or not to include weeks in the input. This will result in an additional
146
- input to capture weeks.
134
+ The value that comes back from the form will also be normalized back into
135
+ this format.
136
+
137
+ minutes
138
+ ~~~~~~~
139
+
140
+ **type **: ``array `` **default **: 0 to 60
141
+
142
+ List of minutes available to the minutes field type. This option is only relevant
143
+ when the ``widget `` option is set to ``choice ``::
144
+
145
+ 'minutes' => range(1, 60)
146
+
147
+ months
148
+ ~~~~~~
149
+
150
+ **type **: ``array `` **default **: 0 to 12
151
+
152
+ List of months available to the months field type. This option is only relevant
153
+ when the ``widget `` option is set to ``choice ``::
154
+
155
+ 'months' => range(1, 12)
156
+
157
+ seconds
158
+ ~~~~~~~
159
+
160
+ **type **: ``array `` **default **: 0 to 60
161
+
162
+ List of seconds available to the seconds field type. This option is only relevant
163
+ when the ``widget `` option is set to ``choice ``::
164
+
165
+ 'seconds' => range(1, 60)
166
+
167
+ weeks
168
+ ~~~~~
169
+
170
+ **type **: ``array `` **default **: 0 to 52
171
+
172
+ List of weeks available to the weeks field type. This option is only relevant
173
+ when the ``widget `` option is set to ``choice ``::
174
+
175
+ 'weeks' => range(1, 52)
176
+
177
+ widget
178
+ ~~~~~~
179
+
180
+ **type **: ``string `` **default **: ``choice ``
181
+
182
+ Defines the ``widget `` option for the single interval component inputs.
147
183
148
184
with_days
149
185
~~~~~~~~~
@@ -161,6 +197,14 @@ with_hours
161
197
Whether or not to include hours in the input. This will result in an additional
162
198
input to capture hours.
163
199
200
+ with_invert
201
+ ~~~~~~~~~~~
202
+
203
+ **type **: ``Boolean `` **default **: ``false ``
204
+
205
+ Whether or not to include invert in the input. This will result in an additional
206
+ input to capture seconds.
207
+
164
208
with_minutes
165
209
~~~~~~~~~~~~
166
210
@@ -169,6 +213,14 @@ with_minutes
169
213
Whether or not to include minutes in the input. This will result in an additional
170
214
input to capture minutes.
171
215
216
+ with_months
217
+ ~~~~~~~~~~~
218
+
219
+ **type **: ``Boolean `` **default **: ``true ``
220
+
221
+ Whether or not to include months in the input. This will result in an additional
222
+ input to capture months.
223
+
172
224
with_seconds
173
225
~~~~~~~~~~~~
174
226
@@ -177,13 +229,21 @@ with_seconds
177
229
Whether or not to include seconds in the input. This will result in an additional
178
230
input to capture seconds.
179
231
180
- with_invert
181
- ~~~~~~~~~~~
232
+ with_weeks
233
+ ~~~~~~~~~~
182
234
183
235
**type **: ``Boolean `` **default **: ``false ``
184
236
185
- Whether or not to include invert in the input. This will result in an additional
186
- input to capture seconds.
237
+ Whether or not to include weeks in the input. This will result in an additional
238
+ input to capture weeks.
239
+
240
+ with_years
241
+ ~~~~~~~~~~
242
+
243
+ **type **: ``Boolean `` **default **: ``true ``
244
+
245
+ Whether or not to include years in the input. This will result in an additional
246
+ input to capture years.
187
247
188
248
years
189
249
~~~~~
@@ -195,66 +255,6 @@ when the ``widget`` option is set to ``choice``::
195
255
196
256
'years' => range(1, 100)
197
257
198
- months
199
- ~~~~~~
200
-
201
- **type **: ``array `` **default **: 0 to 12
202
-
203
- List of months available to the months field type. This option is only relevant
204
- when the ``widget `` option is set to ``choice ``::
205
-
206
- 'months' => range(1, 12)
207
-
208
- weeks
209
- ~~~~~
210
-
211
- **type **: ``array `` **default **: 0 to 52
212
-
213
- List of weeks available to the weeks field type. This option is only relevant
214
- when the ``widget `` option is set to ``choice ``::
215
-
216
- 'weeks' => range(1, 52)
217
-
218
- days
219
- ~~~~
220
-
221
- **type **: ``array `` **default **: 0 to 31
222
-
223
- List of days available to the days field type. This option is only relevant
224
- when the ``widget `` option is set to ``choice ``::
225
-
226
- 'days' => range(1, 31)
227
-
228
- hours
229
- ~~~~~
230
-
231
- **type **: ``array `` **default **: 0 to 24
232
-
233
- List of hours available to the hours field type. This option is only relevant
234
- when the ``widget `` option is set to ``choice ``::
235
-
236
- 'hours' => range(1, 24)
237
-
238
- minutes
239
- ~~~~~~~
240
-
241
- **type **: ``array `` **default **: 0 to 60
242
-
243
- List of minutes available to the minutes field type. This option is only relevant
244
- when the ``widget `` option is set to ``choice ``::
245
-
246
- 'minutes' => range(1, 60)
247
-
248
- seconds
249
- ~~~~~~~
250
-
251
- **type **: ``array `` **default **: 0 to 60
252
-
253
- List of seconds available to the seconds field type. This option is only relevant
254
- when the ``widget `` option is set to ``choice ``::
255
-
256
- 'seconds' => range(1, 60)
257
-
258
258
Inherited Options
259
259
-----------------
260
260
0 commit comments