Extend from $.fn.datebox.defaults, Override defaults with $.fn.datetimebox.defaults.
Similar to the datebox, the datetimebox allows the user to select a date and a time to display the date and time with specified format. It adds a timespinner component to the drop-down panel.
Create datetimebox from markup.
- <input class="easyui-datetimebox" name="birthday"
- data-options="required:true,showSeconds:false" value="3/4/2010 2:3" style="width:150px">
Create datetimebox using javascript.
- <input id="dt" type="text" name="birthday">
- $('#dt').datetimebox({
- value: '3/4/2010 2:3',
- required: true,
- showSeconds: false
- });
The properties extend from datebox, below is the added properties for datetimebox:
Name | Type | Description | Default |
---|---|---|---|
showSeconds | boolean | Defines if to display the second information. | true |
timeSeparator | string | The time separator between hour and minute and second. This property is available since version 1.3. | : |
The methods extend from datebox, below is the overridden methods for datetimebox.
Name | Parameter | Description |
---|---|---|
options | none | Return the options object. |
spinner | none | Return the timespinner object. |
setValue | value |
Set the datetimebox value.
Code example: $('#dt').datetimebox('setValue', '6/1/2012 12:30:56'); // set datetimebox value var v = $('#dt').datetimebox('getValue'); // get datetimebox value alert(v); |