Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3159 closed feature (fixed)

datepicker function to do refresh/redraw

Reported by: anonymous Owned by: kbwood
Priority: trivial Milestone: 1.6rc1
Component: ui.datepicker Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


would be nice if the datepicke had a datepicker("refresh"); function to force the datepicker to redraw itself.

Change History (7)

comment:1 Changed 9 years ago by kbwood

  • Owner changed from grabanski to kbwood
  • Status changed from new to assigned

This shouldn't be necessary as the datepicker should always redraw itself when anything changes. In what circumstances are you seeing a need for this?

comment:2 Changed 9 years ago by pbavinck

I am using datepicker showing special dates. Great that the Month/Year Notify has been fixed so I can load the special dates data (ajax) before displaying the calendar. This refresh request also has to do with special dates. The underlying data structure holding the special dates for the currently displayed month may also change and I would like to instruct the calendar to redraw all month days. I hope that clarifies my request.

Needless to say I think this plugin rocks. Very neat code, well set up!

comment:3 Changed 9 years ago by kbwood

Can you add this to the $.extend(Datepicker.prototype, {... section and test it out?

/* Redraw the date picker attached to an input field or division.

@param target element - the target input field or division or span */

_refreshDatepicker: function(target) {

var inst = $.data(target, PROP_NAME); if (inst) {




comment:4 Changed 9 years ago by pbavinck

Added the code and tested it in my application with an inline datepicker. It works like a charm (in IE6&7, Safari 3.1 (windows) and Firefox 2). I tested with only one datepicker on the page, so I don't know how it behaves with multiple datepickers shown at the same time. Thanks, this code helps me a lot!

comment:5 Changed 9 years ago by Cloudream

  • Milestone set to TDB

comment:6 Changed 9 years ago by kbwood

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

Applied to main code.

comment:7 Changed 8 years ago by rdworth

  • Milestone changed from TBD to 1.6rc1

Please use jsFiddle or jsbin to provide test cases instead of pasting large blocks of code in the ticket.

If you have a fix, fork the repository on GitHub and send a pull request. Make sure to check out the guide for writing code for jQuery projects.

Modify Ticket

Change Properties

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.