I am having a weird problem working with a simple datepicker using jqueryUI. I just want to show a two-month calendar with the last month and current month. I used this code:
$(function () { $('#picker').datepicker({ numberOfMonths: 2, showCurrentAtPos: 1, dateFormat: "yy-mm-dd", onSelect: function () { $('#out').html(this.value); } }); }); <div id="picker"></div> <output id="out"></output>
It displays what I want, but with strange behavior that you can test here:
http://jsfiddle.net/xgvargas/UCbxf/
When you select a date, it jumps to another month, and in some cases, the selected date is no longer displayed, even if the date is correct.
If you delete the line showCurrentAtPos: 1 , this behavior will stop, but in this case I will have the current month and the next, this is not what I need.
Is this a mistake or am I cursing something?
By the way, I am using the latest version of jquery and jqueryUI. And only tested in Chrome so far.
source share