} );
QUnit.test( "change", function( assert ) {
- assert.expect( 4 );
+ assert.expect( 6 );
var shouldFire;
this.element.datepicker( {
- change: function( event ) {
+ change: function( event, ui ) {
assert.ok( shouldFire, "change event fired" );
assert.equal(
event.type,
"datepickerchange",
"change event"
);
+ assert.equal( $.type( ui.value ), "date", "value is a date object" );
}
} );
QUnit.test( "select", function( assert ) {
var ready = assert.async();
- assert.expect( 4 );
+ assert.expect( 6 );
var message = "",
that = this;
this.element.datepicker( {
- select: function( event ) {
+ select: function( event, ui ) {
assert.ok( true, "select event fired " + message );
assert.equal(
event.originalEvent.type,
"calendarselect",
"select originalEvent " + message
);
+ assert.equal( $.type( ui.value ), "date", "value is a date object" );
}
} );
.calendar( $.extend( {}, this.options, {
value: this._parse( this.element.val() ),
change: function( event ) {
- that._trigger( "change", event );
+ that._trigger( "change", event, {
+ value: that.calendarInstance.valueAsDate()
+ } );
},
select: function( event ) {
that.element.val( that.calendarInstance.value() );
that.close();
event.preventDefault();
that._focusTrigger();
- that._trigger( "select", event );
+ that._trigger( "select", event, {
+ value: that.calendarInstance.valueAsDate()
+ } );
return false;
}
this.suppressExpandOnFocus = false;
},
change: function( event ) {
- this._trigger( "change", event );
+ this._trigger( "change", event, {
+ value: this.calendarInstance.valueAsDate()
+ } );
}
},