Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8791

Custom data field date format showing full date when displayed on Contact Record tab, not M yy as specified.

    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"
      );

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              hbergin Helen Bergin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: