? filename.patch
Index: date_popup.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/date/date_popup/date_popup.js,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 date_popup.js
--- date_popup.js	12 Jan 2009 17:23:25 -0000	1.1.2.3
+++ date_popup.js	11 Dec 2009 12:05:15 -0000
@@ -27,4 +27,41 @@ Drupal.behaviors.date_popup = function (
       }
     });
   }
+  $('input[name*="[date][date]"]').each(
+    function( intIndex ){
+      if (Drupal.settings.datePopup[this.id] == undefined) { // not bound yet!
+        // look for valid 'settings' in Drupal.settings.datePopup 
+        var settingsIndex;
+        for (settings in Drupal.settings.datePopup) {
+          var size = this.id.indexOf("-", this.id.indexOf("-")+1) +1; // part of string we can match to
+          if (settings.substr(0, size) == this.id.substr(0,size)) {
+            settingsIndex = settings;
+            break;
+          }
+        }
+        if (settingsIndex != undefined) {
+           $('#'+ this.id).bind('focus', Drupal.settings.datePopup[settingsIndex], function(e) {
+            if (!$(this).hasClass('date-popup-init')) {
+              var datePopup = e.data;
+              // Explicitely filter the methods we accept.
+              switch (datePopup.func) {
+                case 'datepicker':
+                  $(this)
+                    .datepicker(datePopup.settings)
+                    .addClass('date-popup-init')
+                    .focus();
+                  break;
+               case 'timeEntry':
+                  $(this)
+                    .timeEntry(datePopup.settings)
+                    .addClass('date-popup-init')
+                    .focus();
+                  break;
+              }
+            }
+          });
+        }
+      }
+    }
+  )
 };
