inputEx - DateTimeField Usage

Basic DateTimeField creation

Use the following code to create a basic inputEx DateTimeField.

field = new YAHOO.inputEx.DateTimeField({parentEl: 'container1', value: new Date()}); var button = YAHOO.inputEx.cn('button', null, null, 'getValue'); YAHOO.util.Event.addListener(button, "click",function() { alert(field.getValue()); }); YAHOO.util.Dom.get('container1').appendChild(button);

Date format

Change the date format

new YAHOO.inputEx.DateTimeField({parentEl: 'container2', value: new Date(), dateFormat: 'd/m/Y'});