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); 

https://jsfiddle.net/7x0pwtxf/


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -