Multiple-Dates-Picker-for-jQuery-UI icon indicating copy to clipboard operation
Multiple-Dates-Picker-for-jQuery-UI copied to clipboard

Selecting more than one day on the popup calendar and the shown month is changed to the current

Open jpros opened this issue 13 years ago • 2 comments

Using the demo page: http://multidatespickr.sourceforge.net At the From input demo select a day in December, then the popup closes and open again, select another day in December, again the popup closes and open again, but now the month presented is october(the actual current month).

I'm trying to debug, if I found a solution I'll post here.

Anyone else with this problem?

Thanks!

jpros avatar Oct 17 '12 13:10 jpros

I found the problem: When the datepicker will get the date from field, first time is only one date, that it can parse, but when are two dates, it can't parse the string "xx/xx/xxxx, xx/xx/xxxx".

So I created a workaround, probably its not the best, because I'm not familiar with jQuery's inheritance, this is the way I made it to work.

The changes are on jquery.ui.picker.js:

  • on _selectDate method (Line 920): -- add before "if(inst.inline)" the following:
this._lastAdded = dateStr;
  • on _setDateFromField method. (Line 1291): -- add before "var date, defaultDate;" the following:
if(this._lastAdded != undefined) 
    dates = this._lastAdded; 

jpros avatar Oct 17 '12 14:10 jpros

I'm experiencing problems with this as well. Is this a bug in MDP or in the jQueryUI datepicker?

martijnfrazer avatar Oct 13 '14 15:10 martijnfrazer