equal( this.element.calendar( "value" ), "1/1/14", "getter" );
this.element.calendar( "value", "abc" );
- equal( this.element.calendar( "value" ), "1/1/14", "Setting invalid values should be ignored." );
+ equal( this.element.calendar( "value" ), null, "Setting invalid values." );
} );
test( "valueAsDate", function( assert ) {
);
this.element.calendar( "valueAsDate", date1 );
- assert.dateEqual(
+ equal(
this.element.calendar( "valueAsDate" ),
- date2,
+ null,
"Set date min/max - value < min"
);
);
this.element.calendar( "valueAsDate", date2 );
- assert.dateEqual(
+ equal(
this.element.calendar( "valueAsDate" ),
- date1,
+ null,
"Set date min/max - value > max"
);
this.element
.calendar( "option", { min: minDate } )
.calendar( "valueAsDate", date1 );
- assert.dateEqual(
+ equal(
this.element.calendar( "valueAsDate" ),
- date1,
+ null,
"Set date min/max - value < min"
);
this.element.calendar( "valueAsDate", date2 );
- assert.dateEqual(
+ equal(
this.element.calendar( "valueAsDate" ),
- date1, "Set date min/max - value > max"
+ null, "Set date min/max - value > max"
);
dateAndTimeToSet = new Date( 2008, 3 - 1, 28, 1, 11, 0 );
this.element
.calendar( "option", { min: minDate } )
.calendar( "value", "1/4/08" );
- assert.dateEqual( this.element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < min" );
+ equal( this.element.calendar( "valueAsDate" ), null, "Min/max - value < min" );
this.element
.calendar( "option", { min: null } )
this.element
.calendar( "option", { max: maxDate } )
.calendar( "value", "1/4/09" );
- assert.dateEqual( this.element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - setDate > max" );
+ equal( this.element.calendar( "valueAsDate" ), null, "Min/max - setDate > max" );
this.element
.calendar( "option", { min: minDate, max: maxDate } )
.calendar( "value", "1/4/08" );
- assert.dateEqual( this.element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < min" );
+ equal( this.element.calendar( "valueAsDate" ), null, "Min/max - value < min" );
this.element
.calendar( "option", { min: minDate, max: maxDate } )
this.element
.calendar( "option", { min: minDate, max: maxDate } )
.calendar( "value", "1/4/09" );
- assert.dateEqual( this.element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > max" );
+ equal( this.element.calendar( "valueAsDate" ), null, "Min/max - value > max" );
this.element
.calendar( "option", { min: minDate, max: maxDate } )
);
this.element.calendar( "option", "value", "invalid" );
- assert.dateEqual( this.element.calendar( "option", "value" ), date, "Value after invalid parameter" );
+ equal( this.element.calendar( "option", "value" ), null, "Value after invalid parameter" );
} );
/*
if ( arguments.length ) {
this.valueAsDate( this._parse( value ) );
} else {
- return this._format( this.option( "value" ) );
+ return this.option( "value" ) === null ?
+ null : this._format( this.option( "value" ) );
}
},
if ( key === "value" ) {
if ( this._isValid( value ) ) {
this.date.setTime( value.getTime() );
- this._super( key, value );
+ } else {
+ value = null;
}
- return;
}
if ( key === "max" || key === "min" ) {