3

I am using the Multiple-Dates-Picker-for-jQuery-UI. When multiple dates are selected, the calendar opens and closes between each selection. How can I correct this so that the calendar stays open until all dates are selected and then only closes when it is clicked elsewhere in the browser.

Here is my code:

<div class="row">
    <div class="span4">
         <h3>On <a href="#" class="popover-tip" rel="popover"
                 data-content="Pick a date for your night out."
                 data-original-title="Date">
             <i class="icon-question-sign"></i></a></h3>
         <input type="text" class="datepicker">
// Date picker - allows for multi select
$('.datepicker').multiDatesPicker({
    altField: '#altfield',
    dateFormat: "DD, d MM, yy",

    onBeforeShow: function () {
        $('#inputDate').DatePickerSetDate($('#inputDate').val(), true);
    },
    onChange: function (formated, dates) {
        $('#inputDate').val(formated);
        if ($('#closeOnSelect input').attr('checked')) {
            $('#inputDate').DatePickerHide();
        }
    }
});
Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
Mac10
  • 145
  • 4
  • 15

4 Answers4

1

Try getting MultiDatesPicker from http://multidatespickr.sourceforge.net. The version there worked for me.

Mu Mind
  • 10,935
  • 4
  • 38
  • 69
Nagaraj
  • 145
  • 7
  • 1
    Thanks naga. I did read through that and tried to add: table.ui-datepicker-calendar {border-collapse: separate;} .ui-datepicker-calendar td {border: 1px solid transparent;} to the css as they suggest, but it doesnt seem to have an impact – Mac10 Sep 11 '12 at 04:12
  • 1
    I cleaned up this answer, but I don't see how it could help since it looks like it's referring to the same project. – Mu Mind Sep 11 '12 at 05:27
0

Late answer i know but you can remove line 148:

(setTimeout('$("#'+inst.id+'").datepicker("show")',50);)

from jquery-ui.multidatespicker.js

Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
mathew
  • 185
  • 4
  • 20
0

If I understand correctly, your requirement is that you want the calendar permanently open.

To achieve that you only need to change the input for a div.

In your html instead of

 <input type="text" class="datepicker"> 

put this

<div class="datepicker" style="display:block;"></div>

In case you want to have it open while selecting dates and then close it,you will have to show/hide it programatically probably using onfocus and onblur js events or jQuery.

eleonzx
  • 677
  • 10
  • 16
0

Possible duplicate:

Another answer notes that jQuery UI defaulting to today's date when it can't parse several dates. The codefix for _setDateFromField is here

Multiple date picker - months jumping problems

Community
  • 1
  • 1
shukshin.ivan
  • 11,075
  • 4
  • 53
  • 69