jquery ui - Double Click on from date change the to date also in Date range datepicker -
when double click on date in date range datepicker,the date date getting changed well.
$(function() { $( "#from" ).datepicker({ onclose: function( selecteddate ) { $( "#to" ).datepicker( "option", "mindate", selecteddate ); } }); $( "#to" ).datepicker({ onclose: function( selecteddate ) { $( "#from" ).datepicker( "option", "maxdate", selecteddate ); } }); });
here jsfiddle: jsfiddle
it's bug: https://bugs.jqueryui.com/ticket/8907#no1
what happens calling method on datepicker 2 while datepicker 1 open causes datepicker 2 rendered in place of datepicker 1. can see happening selecting date in different month datepicker 2, selecting date in datepicker 1; you'll see month switch datepicker closing.
but if use timeout, things right! see on jsfiddle.
settimeout(function(){ $( "#to" ).datepicker( "option", "mindate", selecteddate );}, 100);
Comments
Post a Comment