Opened 9 years ago

Closed 7 years ago

#6733 closed bug (duplicate)

datepicker bug: error with selecting dates with multiple calendars

Reported by: Enoah Netzach Owned by:
Priority: minor Milestone: 1.11.0
Component: ui.datepicker Version: 1.8.6
Keywords: Cc:
Blocked by: Blocking:

Description

Using Google Chrome 8.0.552.215, Mozilla Firefox 3.6.12, Safari 5.0.2 on a iMac 7,1 with Mac OS X 10.6.5;

Using jquery 1.4.2 and jquery-ui 1.8.6:

Using datepicker inline with multiple calendars (numberOfMonths>=2) and showCurrentAtPos=1, when clicking on a date in the last month on right, the datepicker does not update in the right position, centering on the last selected day, but goes back to the month before the first on the left side.

Used Code

Html:

<body>
  <div id="foo"></div>
</body>

Html:

$('#foo').datepicker({
  numberOfMonths: 2,
  showCurrentAtPos: 1
 })

Online Example

http://jsfiddle.net/RGy43/1/

Change History (4)

comment:1 Changed 9 years ago by Enoah Netzach

partially fixed adding the datepicker option showButtonPanel: true triggering two custom jQuery events on $('body'):

  1. at the very end of $.datepicker._updateDatepicker function ('update' event)
  2. at the very beginning of $.datepicker._updateDatepicker function ('gotoToday' event)

and managing them in a very long and crazy way..

Code highlighting:

var reallyUpdated = false;
$('table.ui-datepicker-calendar > tbody > tr > td').live('mousemove mouseleave', function(event)
{
  (event.type == 'mousemove') ? reallyUpdated = true : reallyUpdated = false;
})
$('.ui-datepicker-buttonpane > button.ui-datepicker-current').live('mousemove mouseleave mousedown', function(event)
{
  (event.type == 'mousemove') ? reallyUpdated = true : reallyUpdated = false;
})
$('body').live('update', function()
{
  if (reallyUpdated)
   {
    $('.ui-datepicker-buttonpane > button.ui-datepicker-current').trigger('click');
    reallyUpdated = false;
   }
});
$('body').live('gotoToday', function()
{
  reallyUpdated = false;
})
Last edited 9 years ago by Enoah Netzach (previous) (diff)

comment:2 Changed 9 years ago by GalaGalaxia

This ticket is related to #6225 which also appears to have a simpler fix.

comment:3 Changed 7 years ago by Scott González

Milestone: 1.9.01.11.0

comment:4 Changed 7 years ago by mikesherov

Resolution: duplicate
Status: newclosed

Duplicate of #6225.

Note: See TracTickets for help on using tickets.