Skip to content
Permalink
Browse files

Fixed 3180 Datepicker automatic ID assignment

  • Loading branch information
Keith Wood
Keith Wood committed Aug 21, 2008
1 parent 5a0431a commit 2fd7f5f035f24b0e3cefae621ecdb3cb4814f2cf
Showing with 3 additions and 2 deletions.
  1. +3 −2 ui/ui.datepicker.js
@@ -168,7 +168,7 @@ $.extend(Datepicker.prototype, {
var nodeName = target.nodeName.toLowerCase();
var inline = (nodeName == 'div' || nodeName == 'span');
if (!target.id)
target.id = 'dp' + new Date().getTime();
target.id = 'dp' + ++this.uuid;
var inst = this._newInst($(target), inline);
inst.settings = $.extend({}, settings || {}, inlineSettings || {});
if (nodeName == 'input') {
@@ -262,7 +262,7 @@ $.extend(Datepicker.prototype, {
_dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
var inst = this._dialogInst; // internal instance
if (!inst) {
var id = 'dp' + new Date().getTime();
var id = 'dp' + ++this.uuid;
this._dialogInput = $('<input type="text" id="' + id +
'" size="1" style="position: absolute; top: -100px;"/>');
this._dialogInput.keydown(this._doKeyDown);
@@ -1679,5 +1679,6 @@ $.fn.datepicker = function(options){

$.datepicker = new Datepicker(); // singleton instance
$.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();

})(jQuery);

0 comments on commit 2fd7f5f

Please sign in to comment.
You can’t perform that action at this time.