Skip to content

Commit 81c4533

Browse files
committed
Datepicker: Document 'events' as options.
1 parent 1e67855 commit 81c4533

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

entries/datepicker.xml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,34 +250,32 @@
250250
<argument name="inst" type="Object"/>
251251
<desc>Called when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. <code>this</code> refers to the associated input field.</desc>
252252
</option>
253-
</options>
254-
<events>
255-
<event name="beforeShow" type="datepickerbeforeshow">
253+
<option name="beforeShow" type="Function">
256254
<desc>Can be a function that takes an input field and current datepicker instance and returns an options object to update the datepicker with. It is called just before the datepicker is displayed.</desc>
257255
<argument name="input" type="jQuery"/>
258256
<argument name="inst" type="jQuery"/>
259-
</event>
260-
<event name="beforeShowDay" type="datepickerbeforeshowday">
257+
</option>
258+
<option name="beforeShowDay" type="Function">
261259
<desc>The function takes a date as a parameter and must return an array with [0] equal to true/false indicating whether or not this date is selectable, [1] equal to a CSS class name(s) or "" for the default presentation, and [2] an optional popup tooltip for this date. It is called for each day in the datepicker before it is displayed.</desc>
262260
<argument name="date" type="Date"/>
263-
</event>
264-
<event name="onChangeMonthYear" type="datepickeronchangenonthyear">
261+
</option>
262+
<option name="onChangeMonthYear" type="Function">
265263
<desc>Allows you to define your own event when the datepicker moves to a new month and/or year. The function receives the selected year, month (1-12), and the datepicker instance as parameters. this refers to the associated input field.</desc>
266264
<argument name="year" type="Integer"/>
267265
<argument name="month" type="Integer"/>
268266
<argument name="inst" type="jQuery"/>
269-
</event>
270-
<event name="onClose" type="datepickeronclose">
267+
</option>
268+
<option name="onClose" type="Function">
271269
<desc>Allows you to define your own event when the datepicker is closed, whether or not a date is selected. The function receives the selected date as text ("" if none) and the datepicker instance as parameters. this refers to the associated input field.</desc>
272270
<argument name="dateTxt" type="String"/>
273271
<argument name="inst" type="jQuery"/>
274-
</event>
275-
<event name="onSelect" type="datepickeronselect">
272+
</option>
273+
<option name="onSelect" type="Function">
276274
<desc>Allows you to define your own event when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. this refers to the associated input field.</desc>
277275
<argument name="dateTxt" type="String"/>
278276
<argument name="inst" type="jQuery"/>
279-
</event>
280-
</events>
277+
</option>
278+
</options>
281279
<methods>
282280
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
283281
<method name="dialog">

0 commit comments

Comments
 (0)