CRM-16267 - Fix copying date fields in profile batch update
authorColeman Watts <coleman@civicrm.org>
Fri, 10 Apr 2015 21:01:42 +0000 (17:01 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 10 Apr 2015 21:01:42 +0000 (17:01 -0400)
templates/CRM/common/batchCopy.tpl

index a9c4ba84a2cfbe644fcd6304e65be4ecf37e1606..7b46b1defae7717b439681185c3f8e4da4a3ba3b 100644 (file)
      * @return void
      */
     function copyValuesDate(fname) {
-      var fnameDisplay = fname + '_display';
-      var fnameTime    = fname + '_time';
-
-      var displayElement = $('.crm-copy-fields [name^="field_"][name$="_' + fnameDisplay +'"][type!=hidden]');
-      var timeElement    = $('.crm-copy-fields [name^="field["][name*="[' + fnameTime +']"][type!=hidden]');
+      var displayElement = $('.crm-copy-fields [name^="field_"][name*="_' + fname +'_display"]:visible');
+      var timeElement    = $('.crm-copy-fields [name^="field["][name*="[' + fname +'_time]"][type!=hidden]');
 
       displayElement.val( displayElement.eq(0).val() );
       timeElement.val( timeElement.eq(0).val() );