Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.5
-
Fix Version/s: 4.1.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
A custom data field with a date format of 'M yy' is displayed as 'September 1st, 2011' instead of 'Sep 2011' when viewed on someone's contact record. It seems not all the possible formats that can be configured are being included in the supportable formats list.
If I change the following code, it shows up correctly:
CRM/Core/BAO/CustomGroup.php
Around Ln 1627 in the formatCustomValues function:
ORIGINAL CODE
$supportableFormats = array(
'mm/dd' => "%B %E%f $customTimeFormat",
'dd-mm' => "%E%f %B $customTimeFormat",
'yy' => "%Y $customTimeFormat"
);
UPDATED CODE
$supportableFormats = array(
'mm/dd' => "%B %E%f $customTimeFormat",
'dd-mm' => "%E%f %B $customTimeFormat",
'yy' => "%Y $customTimeFormat",
'M yy' => "%b %Y $customTimeFormat",
'yy-mm' => "%Y-%m $customTimeFormat"
);