Ticket #3307 (closed bug: fixed)

Opened 7 years ago

Last modified 3 years ago

ui.datepicker range selection causing previous month image to be replaced by text

Reported by: anonymous Owned by: grabanski
Priority: minor Milestone:
Component: ui.datepicker Version: 1.5.2
Keywords: Range Cc:
Blocking: Blocked by:


I am using IE 7.0.5730.13C0 and whenever I try to select a range I can see how the previous image used to go to the previous month is replaced by text after selecting the start date.

Change History

comment:1 Changed 7 years ago by kbwood

Can you attach some sample code that illustrates the problem?

comment:2 Changed 7 years ago by GlowingRose

When previous months are not selectable (in this instance, when selecting a range after the first date, only later months can be selected), the previous "button" is replaced with a form label.

Line 1390, expanded for readability...

var prev = '<div class="ui-datepicker-prev">' + 
  (this._canAdjustMonth(inst, -1, drawYear, drawMonth) 
  ? (showBigPrevNext 
    ? '<a onclick="jQuery.datepicker._adjustDate(\'#' + inst.id + 
      '\', -' + stepBigMonths + ', \'M\');"' + this._addStatus(
      showStatus, inst.id, this._get(inst, 'prevBigStatus'), 
      initStatus) + '>' + prevBigText + '</a>' 
    : ''
    +  '<a onclick="jQuery.datepicker._adjustDate(\'#' + inst.id + 
      '\', -' + stepMonths + ', \'M\');"' +  this._addStatus(
      showStatus, inst.id, this._get(inst, 'prevStatus'), 
      initStatus) + '>' + prevText + '</a>' 
  :  (hideIfNoPrevNext 
    ? '' 
    : (showBigPrevNext 
      ? '<label>' + prevBigText + '</label>' 
      : ''
      + '<label>' + prevText + '</label>'
  + '</div>';

This is mildly annoying as prevText is displayed instead of the nice looking previous arrow graphic. To work around this, set hideIfNoPrevNext to true to hide the label in this case.

A better solution would be to show a disabled version of the previous arrow graphic. Something like '<a href="#" class="ui-datepicker-prev-disabled">' + prevText + '</a>' and have ui-datepicker-prev-disabled lower the opacity to 50%.

comment:3 Changed 7 years ago by kbwood

  • Status changed from new to closed
  • Resolution set to fixed

Refactored datepicker CSS to restore full functionality and fix errors.

comment:4 Changed 3 years ago by scott.gonzalez

  • Milestone TBD deleted

Milestone TBD deleted

Note: See TracTickets for help on using tickets.