Opened 12 years ago

Closed 12 years ago

#3146 closed bug (fixed)

Inconsistent year/month change notify (user callback)

Reported by: bavinckp@… Owned by: grabanski
Priority: major Milestone:
Component: ui.datepicker Version: 1.5.2
Keywords: onChangeMonthYear Cc:
Blocked by: Blocking:

Description

Changing month/year can be done in differnt ways:

  1. prev/next button
  2. select boxes
  3. setDate
  1. In all of these case the notify month/year (user callback function) should be send at the same time.

My strong preference is for this to take place BEFORE the calendar is drawn. This is the behaviour of the prev/next buttons.

  1. The select boxes also send the notify but AFTER the calendar has been drawn. This is unfortunate, because this prevents the developer to for instance update dynamic special day before the calendar is drawn.

Suggested fix: change the order of ´this._adjustDate(target);´ and ´this._notifyChange(inst);´ in "_selectMonthYear: function(id, select, period)".

  1. the setDate does not send a notify at all (add ´this._notifyChange(inst);´ before ´this._updateDatepicker(inst);´ in ´_setDateDatepicker: function(target, date, endDate)´, preferably with some intelligence checking whether month-year actually changed.

Change History (1)

comment:1 Changed 12 years ago by kbwood

Resolution: fixed
Status: newclosed

Fixed. onChangeMonthYear is now called before the change is rendered and is now triggerred by setDate if necessary.

Note: See TracTickets for help on using tickets.