jQuery EasyUI Form Plugin - Datetimebox
jQuery EasyUI Plugins
Extends $.fn.datebox.defaults. Override the default defaults via $.fn.datetimebox.defaults.
Similar to the datebox, the datetimebox allows users to select a date and time, displaying them with a specified format. It adds a timespinner component to the drop-down panel.
Depends on
- datebox
- timespinner
Usage
Create a datetimebox from markup.
Create a datetimebox using JavaScript.
$('#dt').datetimebox({
value: '3/4/2010 2:3',
required: true,
showSeconds: false
});
property
This property extends from the datebox; the following are properties added for the datetimebox.
| Name | Type | Description | Default value |
|---|---|---|---|
| showSeconds | boolean | Defines whether to show seconds. | true |
| timeSeparator | string | The separator between hours, minutes, and seconds. Available since version 1.3. | : |
Method
This method extends from the datebox; the following are methods overridden for the datetimebox.
| Name | Parameters | Description |
|---|---|---|
| options | none | Return the options object. |
| spinner | none | Returns the timespinner object. |
| setValue | value | Sets the value of the datetimebox. |
代码实例:
$('#dt').datetimebox('setValue', '6/1/2012 12:30:56'); // set datetimebox value var v = $('#dt').datetimebox('getValue'); // get datetimebox value alert(v); |
jQuery EasyUI Plugins