} );
QUnit.test( "change", function( assert ) {
- assert.expect( 6 );
+ assert.expect( 8 );
var shouldFire, eventType;
this.element.calendar( {
- change: function( event ) {
+ change: function( event, ui ) {
assert.ok( shouldFire, "change event fired" );
assert.equal(
event.type,
eventType,
"change originalEvent on calendar button " + eventType
);
+ assert.equal( $.type( ui.value ), "date", "value is a date object" );
}
} );
} );
QUnit.test( "select", function( assert ) {
- assert.expect( 6 );
+ assert.expect( 8 );
var ready = assert.async(),
that = this,
message, eventType;
this.element.calendar( {
- select: function( event ) {
+ select: function( event, ui ) {
assert.ok( true, "select event fired " + message );
assert.equal(
event.type,
eventType,
"select originalEvent " + message
);
+ assert.equal( $.type( ui.value ), "date", "value is a date object" );
}
} );
this._updateDayElement( "ui-state-active" );
// Allow datepicker to handle focus
- if ( this._trigger( "select", event ) !== false ) {
+ if ( this._trigger( "select", event, { value: this.options.value } ) !== false ) {
this.activeDescendant.closest( this.grid ).focus();
event.preventDefault();
}
if ( oldValue !== this.options.value.getTime() ) {
- this._trigger( "change", event );
+ this._trigger( "change", event, { value: this.options.value } );
}
},