mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Calendar: Remove option method overwrite
This commit is contained in:
parent
32891588f4
commit
ee83c37e0f
@ -55,7 +55,7 @@ test( "valueAsDate", function() {
|
||||
var minDate, maxDate, dateAndTimeToSet, dateAndTimeClone,
|
||||
element = $( "#calendar" ).calendar(),
|
||||
date1 = new Date( 2008, 6 - 1, 4 ),
|
||||
date2 = new Date();
|
||||
date2;
|
||||
|
||||
element.calendar( "valueAsDate", new Date( 2014, 0, 1 ) );
|
||||
ok( element.find( "a[data-timestamp]:first" ).hasClass( "ui-state-active" ), "First day marked as selected" );
|
||||
@ -64,7 +64,7 @@ test( "valueAsDate", function() {
|
||||
element.calendar( "destroy" );
|
||||
|
||||
element.calendar();
|
||||
TestHelpers.calendar.equalsDate( element.calendar( "valueAsDate" ), date2, "Set date - default" );
|
||||
equal( element.calendar( "valueAsDate" ), null, "Set date - default" );
|
||||
|
||||
element.calendar( "valueAsDate", date1 );
|
||||
TestHelpers.calendar.equalsDate(element.calendar( "valueAsDate" ), date1, "Set date - 2008-06-04" );
|
||||
|
@ -486,7 +486,7 @@ return $.widget( "ui.calendar", {
|
||||
if ( arguments.length ) {
|
||||
this._setOption( "value", value );
|
||||
} else {
|
||||
return this.option( "value" );
|
||||
return this.options.value;
|
||||
}
|
||||
},
|
||||
|
||||
@ -519,20 +519,14 @@ return $.widget( "ui.calendar", {
|
||||
.empty();
|
||||
},
|
||||
|
||||
option: function( key ) {
|
||||
if ( arguments.length === 0 || ( arguments.length === 1 && key === "value" ) ) {
|
||||
this.options.value = this.date.selectedDate();
|
||||
}
|
||||
|
||||
return this._superApply( arguments );
|
||||
},
|
||||
|
||||
_setOption: function( key, value ) {
|
||||
if ( key === "value" ) {
|
||||
if ( this._isValid( value ) ) {
|
||||
this.date.setTime( value.getTime() ).select();
|
||||
this._super( key, value );
|
||||
this.refresh();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( key === "max" || key === "min" ) {
|
||||
|
Loading…
Reference in New Issue
Block a user