E
E
Eugene2019-03-12 12:00:13
JavaScript
Eugene, 2019-03-12 12:00:13

Why in jQueryUI Datepicker the onSelect event doesn't see setDate?

Tell me this question, I initialize the datepicker, after I listen to the "date picker" event - onSelect.
And if you choose the date yourself, then it works. But if I set the dates through the api function "setDate", then the event does not fire.

Working example of this code: https://jsfiddle.net/atach/mfkgyxnv/8/

$( "#datepicker" ).datepicker();
$( "#datepicker" ).datepicker( "option", "onSelect", function (dt) {
  alert("1");
});
$( "#datepicker" ).datepicker( "setDate", '03/22/2019' );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maximw, 2019-03-12
@atachrus

https://jsfiddle.net/53xr6b0e/
$('.ui-datepicker-current-day').click();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question