Modify

Opened 9 years ago

Closed 9 years ago

#3080 closed bug (fixed)

Datepicker calls _setDateFromField on a div when inline

Reported by: anonymous Owned by: grabanski
Priority: major Milestone:
Component: ui.datepicker Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:

Description

When you have an inline datepicker and set it's date from .datepicker('setDate') immediately after instantiating it, the datepicker('getDate') function will return null until a date is manually selected. I think I tracked this down to line 275-276 where the _getDatePicker function calls _setDateFromField. By adding an extra check to see if the datepicker is a div before trying to call _setDateFromField I fixed it for my needs, but it might be a bit hackish...

Revised it looks like this

ui.datepicker.js lines 275 and 276

if (inst && ($(target).get(0).tagName != 'DIV'))
    inst._setDateFromField($(target));

Change History (1)

comment:1 Changed 9 years ago by kbwood

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

Fixed - _setDateFromField is not called if the datepicker is inline.

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
Author


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

 
Note: See TracTickets for help on using tickets.