Anita44 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

datePickerMutlMonth plugin issue #221

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the mutlimonth plugin, I needed to bind to the dateSelected callback-to 
add the date to a selector list. However whenever a date was selected in one of 
the non-primary months, the callback was not called.

If the following code is changed in the plug-in from the original to the new, 
it fixes the problem (I don't believe it introduces any bugs):

ORIGINAL
.bind(
     'dateSelected',
     function(event, date, $td, status)
     {
         if (first) {
            $dpmm.trigger('dateSelected', [date, $td, status]);
         } else {
            pickers[i-1].dpSetSelected(date.asString(), status, false);
         }
         if (!last) {
             pickers[i+1].dpSetSelected(date.asString(), status, false);
         }
         return false;
     }
  );

NEW:
.bind(
     'dateSelected',
     function(event, date, $td, status)
     {
         $dpmm.trigger('dateSelected', [date, $td, status]);
         if (!first) {
            pickers[i-1].dpSetSelected(date.asString(), status, false);
         }
         if (!last) {
             pickers[i+1].dpSetSelected(date.asString(), status, false);
         }
         return false;
     }
  );

Original issue reported on code.google.com by dthomp...@gmail.com on 2 Jul 2010 at 4:26

GoogleCodeExporter commented 9 years ago
Never mind. Please ignore this patch and close the issue. This was caused by a 
different issue that I had caused when hacking the actual datePicker. Now that 
I went back to the latest version without my hacks. The multimonth plug-in is 
behaving as expected.

Original comment by dthomp...@gmail.com on 2 Jul 2010 at 4:32

GoogleCodeExporter commented 9 years ago
Thanks for the update - closing the issue...

Original comment by kelvin.l...@gmail.com on 12 Jul 2010 at 2:33