DateTimeBox

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.

Dependencies

Usage Example

Create datetimebox from markup.

  1. <input class="easyui-datetimebox" name="birthday"   
  2.         data-options="required:true,showSeconds:false" value="3/4/2010 2:3" style="width:150px">  

Create datetimebox using javascript.

  1. <input id="dt" type="text" name="birthday"></input>  
  1. $('#dt').datetimebox({  
  2.     value: '3/4/2010 2:3',  
  3.     required: true,  
  4.     showSeconds: false  
  5. });  

Properties

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. :

Methods

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);