Debian Codegraph @

src/docs/options.html

raw
1 <!-- ############################################################################# -->
2 <!-- Options
3 <!-- ############################################################################# -->
4 <div id="tp-options">
5 <h2>Options</h2>
6
7 <p>The timepicker does inherit all options from datepicker. However, there are many options that are shared by them both, and many timepicker only options:</p>
8
9 <h3>Localization Options</h3>
10 <dl class="defs">
11 <dt>currentText</dt>
12 <dd><em>Default: "Now", A Localization Setting</em> - Text for the Now button.</dd>
13
14 <dt>closeText</dt>
15 <dd><em>Default: "Done", A Localization Setting</em> - Text for the Close button.</dd>
16
17 <dt>amNames</dt>
18 <dd><em>Default: ['AM', 'A'], A Localization Setting</em> - Array of strings to try and parse against to determine AM.</dd>
19
20 <dt>pmNames</dt>
21 <dd><em>Default: ['PM', 'P'], A Localization Setting</em> - Array of strings to try and parse against to determine PM.</dd>
22
23 <dt>timeFormat</dt>
24 <dd><em>Default: "HH:mm", A Localization Setting</em> - String of format tokens to be replaced with the time. <a href="#tp-formatting" title="Formatting" onclick="$('#tabs').tabs('select',2);">See Formatting</a>.</dd>
25
26 <dt>timeSuffix</dt>
27 <dd><em>Default: "", A Localization Setting</em> - String to place after the formatted time.</dd>
28
29 <dt>timeOnlyTitle</dt>
30 <dd><em>Default: "Choose Time", A Localization Setting</em> - Title of the wigit when using only timepicker.</dd>
31
32 <dt>timeText</dt>
33 <dd><em>Default: "Time", A Localization Setting</em> - Label used within timepicker for the formatted time.</dd>
34
35 <dt>hourText</dt>
36 <dd><em>Default: "Hour", A Localization Setting</em> - Label used to identify the hour slider.</dd>
37
38 <dt>minuteText</dt>
39 <dd><em>Default: "Minute", A Localization Setting</em> - Label used to identify the minute slider.</dd>
40
41 <dt>secondText</dt>
42 <dd><em>Default: "Second", A Localization Setting</em> - Label used to identify the second slider.</dd>
43
44 <dt>millisecText</dt>
45 <dd><em>Default: "Millisecond", A Localization Setting</em> - Label used to identify the millisecond slider.</dd>
46
47 <dt>microsecText</dt>
48 <dd><em>Default: "Microsecond", A Localization Setting</em> - Label used to identify the microsecond slider.</dd>
49
50 <dt>timezoneText</dt>
51 <dd><em>Default: "Timezone", A Localization Setting</em> - Label used to identify the timezone slider.</dd>
52
53 <dt>isRTL</dt>
54 <dd><em>Default: false, A Localization Setting</em> - Right to Left support.</dd>
55 </dl>
56
57 <h3>Alt Field Options</h3>
58 <dl class="defs">
59
60 <dt>altFieldTimeOnly</dt>
61 <dd><em>Default: true</em> - When altField is used from datepicker altField will only receive the formatted time and the original field only receives date.</dd>
62
63 <dt>altSeparator</dt>
64 <dd><em>Default: (separator option)</em> - String placed between formatted date and formatted time in the altField.</dd>
65
66 <dt>altTimeSuffix</dt>
67 <dd><em>Default: (timeSuffix option)</em> - String always placed after the formatted time in the altField.</dd>
68
69 <dt>altTimeFormat</dt>
70 <dd><em>Default: (timeFormat option)</em> - The time format to use with the altField.</dd>
71
72 <dt>altRedirectFocus</dt>
73 <dd><em>Default: true</em> - Whether to immediately focus the main field whenever the altField receives focus. Effective at construction time only, changing it later has no effect.</dd>
74 </dl>
75
76 <h3>Timezone Options</h3>
77 <dl class="defs">
78
79 <dt>timezoneList</dt>
80 <dd><em>Default: [generated timezones]</em> - An array of timezones used to populate the timezone select. Can be an array of values or an array of objects: { label: "EDT", value: -240 }. The value should be the offset number in minutes. So "-0400" which is the format "-hhmm", would equate to -240 minutes.</dd>
81 </dl>
82
83 <h3>Time Field Options</h3>
84 <dl class="defs">
85
86 <dt>controlType</dt>
87 <dd><em>Default: 'slider'</em> - Whether to use 'slider' or 'select'. If 'slider' is unavailable through jQueryUI, 'select' will be used. For advanced usage you may pass an object which implements "create", "options", "value" methods to use controls other than sliders or selects. See the _controls property in the source code for more details.
88 <pre>{
89 create: function(tp_inst, obj, unit, val, min, max, step){
90 // generate whatever controls you want here, just return obj
91 },
92 options: function(tp_inst, obj, unit, opts, val){
93 // if val==undefined return the value, else return obj
94 },
95 value: function(tp_inst, obj, unit, val){
96 // if val==undefined return the value, else return obj
97 }
98 }</pre>
99 </dd>
100
101 <dt>showHour</dt>
102 <dd><em>Default: null</em> - Whether to show the hour control. The default of null will use detection from timeFormat.</dd>
103
104 <dt>showMinute</dt>
105 <dd><em>Default: null</em> - Whether to show the minute control. The default of null will use detection from timeFormat.</dd>
106
107 <dt>showSecond</dt>
108 <dd><em>Default: null</em> - Whether to show the second control. The default of null will use detection from timeFormat.</dd>
109
110 <dt>showMillisec</dt>
111 <dd><em>Default: null</em> - Whether to show the millisecond control. The default of null will use detection from timeFormat.</dd>
112
113 <dt>showMicrosec</dt>
114 <dd><em>Default: null</em> - Whether to show the microsecond control. The default of null will use detection from timeFormat.</dd>
115
116 <dt>showTimezone</dt>
117 <dd><em>Default: null</em> - Whether to show the timezone select.</dd>
118
119 <dt>showTime</dt>
120 <dd><em>Default: true</em> - Whether to show the time selected within the datetimepicker.</dd>
121
122 <dt>stepHour</dt>
123 <dd><em>Default: 1</em> - Hours per step the slider makes.</dd>
124
125 <dt>stepMinute</dt>
126 <dd><em>Default: 1</em> - Minutes per step the slider makes.</dd>
127
128 <dt>stepSecond</dt>
129 <dd><em>Default: 1</em> - Seconds per step the slider makes.</dd>
130
131 <dt>stepMillisec</dt>
132 <dd><em>Default: 1</em> - Milliseconds per step the slider makes.</dd>
133
134 <dt>stepMicrosec</dt>
135 <dd><em>Default: 1</em> - Microseconds per step the slider makes.</dd>
136
137 <dt>hour</dt>
138 <dd><em>Default: 0</em> - Initial hour set.</dd>
139
140 <dt>minute</dt>
141 <dd><em>Default: 0</em> - Initial minute set.</dd>
142
143 <dt>second</dt>
144 <dd><em>Default: 0</em> - Initial second set.</dd>
145
146 <dt>millisec</dt>
147 <dd><em>Default: 0</em> - Initial millisecond set.</dd>
148
149 <dt>microsec</dt>
150 <dd><em>Default: 0</em> - Initial microsecond set. Note: Javascript's native Date object does not natively support microseconds. Timepicker adds ability to simply Date.setMicroseconds(m) and Date.getMicroseconds(). Date comparisons will not acknowledge microseconds. Use this only for display purposes.</dd>
151
152 <dt>timezone</dt>
153 <dd><em>Default: null</em> - Initial timezone set. This is the offset in minutes. If null the browser's local timezone will be used. If you're timezone is "-0400" you would use -240. For backwards compatibility you may pass "-0400", however the timezone is stored in minutes and more reliable.</dd>
154
155 <dt>hourMin</dt>
156 <dd><em>Default: 0</em> - The minimum hour allowed for all dates.</dd>
157
158 <dt>minuteMin</dt>
159 <dd><em>Default: 0</em> - The minimum minute allowed for all dates.</dd>
160
161 <dt>secondMin</dt>
162 <dd><em>Default: 0</em> - The minimum second allowed for all dates.</dd>
163
164 <dt>millisecMin</dt>
165 <dd><em>Default: 0</em> - The minimum millisecond allowed for all dates.</dd>
166
167 <dt>microsecMin</dt>
168 <dd><em>Default: 0</em> - The minimum microsecond allowed for all dates.</dd>
169
170 <dt>hourMax</dt>
171 <dd><em>Default: 23</em> - The maximum hour allowed for all dates.</dd>
172
173 <dt>minuteMax</dt>
174 <dd><em>Default: 59</em> - The maximum minute allowed for all dates.</dd>
175
176 <dt>secondMax</dt>
177 <dd><em>Default: 59</em> - The maximum second allowed for all dates.</dd>
178
179 <dt>millisecMax</dt>
180 <dd><em>Default: 999</em> - The maximum millisecond allowed for all dates.</dd>
181
182 <dt>microsecMax</dt>
183 <dd><em>Default: 999</em> - The maximum microsecond allowed for all dates.</dd>
184
185 <dt>hourGrid</dt>
186 <dd><em>Default: 0</em> - When greater than 0 a label grid will be generated under the slider. This number represents the units (in hours) between labels.</dd>
187
188 <dt>minuteGrid</dt>
189 <dd><em>Default: 0</em> - When greater than 0 a label grid will be generated under the slider. This number represents the units (in minutes) between labels.</dd>
190
191 <dt>secondGrid</dt>
192 <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in seconds) between labels.</dd>
193
194 <dt>millisecGrid</dt>
195 <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in milliseconds) between labels.</dd>
196
197 <dt>microsecGrid</dt>
198 <dd><em>Default: 0</em> - When greater than 0 a label grid will be genereated under the slider. This number represents the units (in microseconds) between labels.</dd>
199 </dl>
200
201 <h3>Other Options</h3>
202 <dl class="defs">
203 <dt>showButtonPanel</dt>
204 <dd><em>Default: true</em> - Whether to show the button panel at the bottom. This is generally needed.</dd>
205
206 <dt>timeInput</dt>
207 <dd><em>Default: false</em> - Allows direct input in time field</dd>
208
209 <dt>timeOnly</dt>
210 <dd><em>Default: false</em> - Hide the datepicker and only provide a time interface.</dd>
211
212 <dt>timeOnlyShowDate</dt>
213 <dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
214
215 <dt>afterInject</dt>
216 <dd><em>Default: null</em> - Function to be called when the timepicker or selection control is injected or re-rendered. Called in the context of the timepicker instance.</dd>
217
218 <dt>onSelect</dt>
219 <dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
220
221 <dt>alwaysSetTime</dt>
222 <dd><em>Default: true</em> - Always have a time set internally, even before user has chosen one.</dd>
223
224 <dt>separator</dt>
225 <dd><em>Default: " "</em> - When formatting the time this string is placed between the formatted date and formatted time.</dd>
226
227 <dt>pickerTimeFormat</dt>
228 <dd><em>Default: (timeFormat option)</em> - How to format the time displayed within the timepicker.</dd>
229
230 <dt>pickerTimeSuffix</dt>
231 <dd><em>Default: (timeSuffix option)</em> - String to place after the formatted time within the timepicker.</dd>
232
233 <dt>showTimepicker</dt>
234 <dd><em>Default: true</em> - Whether to show the timepicker within the datepicker.</dd>
235
236 <dt>oneLine</dt>
237 <dd><em>Default: false</em> - Try to show the time dropdowns all on one line. This should be used with controlType 'select' and as few units as possible.</dd>
238
239 <dt>addSliderAccess</dt>
240 <dd><em>Default: false</em> - Adds the <a href="http://trentrichardson.com/examples/jQuery-SliderAccess/" title="jQueryUI Slider Access Plugin">sliderAccess plugin</a> to sliders within timepicker</dd>
241
242 <dt>sliderAccessArgs</dt>
243 <dd><em>Default: null</em> - Object to pass to sliderAccess when used.</dd>
244
245 <dt>defaultValue</dt>
246 <dd><em>Default: null</em> - String of the default time value placed in the input on focus when the input is empty.</dd>
247
248 <dt>minDateTime</dt>
249 <dd><em>Default: null</em> - Date object of the minimum datetime allowed. Also available as minDate.</dd>
250
251 <dt>maxDateTime</dt>
252 <dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
253
254 <dt>minTime</dt>
255 <dd><em>Default: null</em> - String of the minimum time allowed. '8:00 am' will restrict to times after 8am</dd>
256
257 <dt>maxTime</dt>
258 <dd><em>Default: null</em> - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm</dd>
259
260 <dt>parse</dt>
261 <dd><em>Default: 'strict'</em> - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:
262 <pre>{
263 hour: 19,
264 minute: 10,
265 second: 23,
266 millisec: 45,
267 microsec: 23,
268 timezone: '-0400'
269 }</pre>
270 </dd>
271 </dl>
272
273 </div>