Skip to main content

Search and Top Navigation

#6733 closed bug (duplicate)

Opened December 08, 2010 04:55PM UTC

Closed October 19, 2012 04:26PM UTC

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

#!div style="font-size: 100%"
Html:
  {{{#!text/html
<body>
  <div id="foo"></div>
</body>
  

}}}

#!div style="font-size: 100%"
Html:
  {{{#!js
$('#foo').datepicker({
  numberOfMonths: 2,
  showCurrentAtPos: 1
 })
  

}}}


Online Example

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

Attachments (0)
Change History (4)

Changed December 08, 2010 05:03PM UTC by Enoah Netzach comment:1

_comment0: partially fixed 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.. \ \ {{{ \ #!div style="font-size: 100%" \ Code highlighting: \ {{{#!js \ 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; \ }) \ }}} \ }}} \ \ 1291827952849942

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..

#!div style="font-size: 100%"
Code highlighting:
  {{{#!js
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;
})
  

}}}

Changed March 11, 2011 05:51PM UTC by GalaGalaxia comment:2

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

Changed October 11, 2012 02:43PM UTC by scottgonzalez comment:3

milestone: 1.9.01.11.0

Changed October 19, 2012 04:26PM UTC by mikesherov comment:4

resolution: → duplicate
status: newclosed

Duplicate of #6225.