From 2fd7f5f035f24b0e3cefae621ecdb3cb4814f2cf Mon Sep 17 00:00:00 2001 From: Keith Wood Date: Thu, 21 Aug 2008 09:16:35 +0000 Subject: [PATCH] Fixed 3180 Datepicker automatic ID assignment --- ui/ui.datepicker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index fee8ed9a8..10a11ba15 100644 --- a/ui/ui.datepicker.js +++ b/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 = $(''); 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);