Ticket #5984 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

Datepicker showing multiple months highlights selected day in all of them

Reported by: kbwood Owned by:
Priority: major Milestone: 1.8.6
Component: ui.datepicker Version: 1.8.4
Keywords: Cc:
Blocking: Blocked by:


From forums:  http://forum.jquery.com/topic/datepicker-showing-multiple-months-highlights-selected-day-in-all-of-them.

If you configure a datepicker to show multiple months, and the field it's tied to has a date entered, when the picker opens it highlights that day of the month in all displayed months. You can see this happen in the 'Display multiple months' demo, by clicking in the field to open the picker, choosing a date, then opening the picker again. Whatever day you picked is highlighted in all months, so there's no way to tell which one is actually selected.

Revert the change made here (jquery.ui.datepicker.js, line 1496):

            (printDate.getTime() == selectedDate.getTime() ? ' ui-state-active' : '') + // highlight selected day

to this:

            (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day


jquery-ui-1.8.5.custom.min.js Download (199.5 KB) - added by ergec 4 years ago.
Fixed Javascript File

Change History

comment:1 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from TBD to 1.9

Fixed in  a936eb3.

Changed 4 years ago by ergec

Fixed Javascript File

comment:2 in reply to: ↑ description Changed 4 years ago by ergec

If you are using minified & combined version of UI downloaded through ThemeRoller (jquery-ui-1.8.5.custom.min.js), you won't be able to find the line mentioned above.

Instead, try to change this (jquery-ui-1.8.5.custom.min.js, line 534):

q.getTime()==J.getTime()?" ui-state-active":""

into this:

q.getTime()==u.getTime()?" ui-state-active":""

comment:3 Changed 3 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.6

comment:4 Changed 3 years ago by Lim Chee Aun

Datepicker: Hightlight the curerent date, not the selected date. Fixes #5984 - Datepicker showing multiple months highlights selected day in all of them

Changeset: a936eb3c0982293940a3f3135fc85178bf17534d

Note: See TracTickets for help on using tickets.