In CiviCrm 4.7 Drupal I created a new Name Badge Layout which includes Event End Date. The site language is Italian, so I need the date to be printed as "15 Ottobre 2016", but it comes out as "Ottobre 15th", which does not make any sense.

Where can I change this setting? I looked everywhere but it seems to be hardcoded somewhere and I can't it.

Many thanks.

  • There are date settings here: civicrm/admin/setting/preferences/date?reset=1
    – petednz - fuzion
    Sep 28 '16 at 20:06
  • I know that, but those settings seem to have no effect at all on the way the date is printed on the badge, which is a format that does not exist in any of my settings.
    – F Grassi
    Sep 29 '16 at 8:55

Ok, I found it.

In CRM/Badge/BAO/Badge.php around line 101 it says:

// hack to fix date field display format
if (strpos($element, '_date')) {
  $value = CRM_Utils_Date::customFormat($value, "%B %E%f");

So I just re-hacked the hack and replaced "%B %E%f" with "%e %B %Y".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.