incorrect date set with setDate in jquery ui calendar
I have a weird situation with jquery ui calendar's setDate.
I have two date pickers - checkin and check out.
$("#checkin").datepicker({
onSelect: function(date,dateObj){
var selectedDate = new Date(date);
selectedDate.setDate( selectedDate.getDate() + 1 );
开发者_开发问答 $("#checkout").datepicker("setDate", selectedDate);
}
});
let's say I have selected 6/1/2011, then checkout date should be 6/2/2011, but I get 6/7/2011.
Do I have an error within my code or is this a bug?
It seems to be working here:
http://jsfiddle.net/rt3nC/8/
精彩评论