CRM-18349: Custom date field default value not set on 'On Behalf of' Profiles
authordeb.monish <monish.deb@webaccessglobal.com>
Fri, 8 Apr 2016 06:36:49 +0000 (12:06 +0530)
committerdeb.monish <monish.deb@webaccessglobal.com>
Fri, 8 Apr 2016 15:49:58 +0000 (21:19 +0530)
CRM/Core/Page/AJAX/Location.php

index 403f1c4e9137dc55f03ba434e9396fa2e39b6686..4d128c1228866e60e50a6d6749cebff5d045f3ef 100644 (file)
@@ -180,8 +180,8 @@ class CRM_Core_Page_AJAX_Location {
           }
           elseif ($htmlType == 'Select Date') {
             $elements["onbehalf_{$key}"]['type'] = $htmlType;
-            $elements["onbehalf_{$key}"]['value'] = $defaults[$key];
-            $elements["onbehalf_{$key}_display"]['value'] = $defaults[$key];
+            //CRM-18349, date value must be ISO formatted before being set as a default value for crmDatepicker custom field
+            $elements["onbehalf_{$key}"]['value'] = CRM_Utils_Date::processDate($defaults[$key], NULL, FALSE, 'Y-m-d G:i:s');
           }
           else {
             $elements["onbehalf_{$key}"]['type'] = $htmlType;