Treat each picker independently

Closes #8515
This commit is contained in:
Mike Jolley 2015-07-07 11:49:12 +01:00
parent 85dcee63ae
commit 358da00b15
2 changed files with 14 additions and 16 deletions

View File

@ -225,21 +225,19 @@ jQuery( function( $ ) {
}).change();
// DATE PICKER FIELDS
var dates = $( '.sale_price_dates_fields input' ).datepicker({
defaultDate: '',
dateFormat: 'yy-mm-dd',
numberOfMonths: 1,
showButtonPanel: true,
onSelect: function( selectedDate ) {
var option = $( this ).is( '#_sale_price_dates_from, .sale_price_dates_from' ) ? 'minDate' : 'maxDate';
var instance = $( this ).data( 'datepicker' ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( 'option', option, date );
}
$( '.sale_price_dates_fields' ).each( function() {
var dates = $( this ).find( 'input' ).datepicker({
defaultDate: '',
dateFormat: 'yy-mm-dd',
numberOfMonths: 1,
showButtonPanel: true,
onSelect: function( selectedDate ) {
var option = $( this ).is( '#_sale_price_dates_from, .sale_price_dates_from' ) ? 'minDate' : 'maxDate';
var instance = $( this ).data( 'datepicker' );
var date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings );
dates.not( this ).datepicker( 'option', option, date );
}
});
});
// ATTRIBUTE TABLES

File diff suppressed because one or more lines are too long