3

I am trying to work with the CiviEvent widget but several things baffle me. First, the date format is all wrong and I don't see a way to change that? The date is correct on the event page, but not in CiviEvent.

What I have: Date format is set to %E.%b%Y %H:%M
What I get: Okt. 22, 2023 5:15 pm
What I expect: 22.Okt.2023 17:15

How can I get the widget to output the correct date format?

Edit: I see that the plugin was last updated 5 years ago and this bug has already been reported 4½ years ago, so I guess the code is abandoned and there will be no solution to this problem until someone publishes a fork that fixes this. Dang!

Edit 2: I contacted the devs and they responded that "It's definitely patch-welcome, so not strictly abandoned, but we aren't proactively doing work on it." I am not a sufficiently skilled developer to fix this, so it will have to be that way.

2 Answers 2

0

Try: Administer > Localisation > Date Formats

6
0

At lines 188-200 in civievent-widget.php

You can change the original parameters to %d.%B.%Y and %H:%M

// Get date and time formats.
    $params = array( 'name' => 'date_format' );
    $values = array();
    CRM_Core_DAO::commonRetrieve( 'CRM_Core_DAO_PreferencesDate', $params, $values );
    $this->_dateFormat = CRM_Utils_Array::value( 'date_format', $values, '%A %d %B %Y' );
    $params = array( 'name' => 'time_format' );
    $values = array();
    CRM_Core_DAO::commonRetrieve( 'CRM_Core_DAO_PreferencesDate', $params, $values );
    $this->_timeFormat = CRM_Utils_Array::value( 'time_format', $values, '%H:%M' );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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