The Open Atrium Event Detail view uses a custom formatter for the Event Date: "Next Upcoming Date" for both the Date and the Time of the event. These dates cannot be localized so one is forced to use a normal date and time display, but then one loses the labels.

The involved code is in oa_events.module starting from line 226

    // Create an array of time / date information for ease of use.
    $dates = array(
      'start' => array(
        'time' => date_format_date($start_date, 'custom', 'g:iA'),
        'date' => date_format_date($start_date, 'custom', 'l, M j, Y'),
      ),
      'end' => array(
        'time' => date_format_date($end_date, 'custom', 'g:iA'),
        'date' => date_format_date($end_date, 'custom', 'l, M j, Y'),
      ),
    );
CommentFileSizeAuthor
#4 localize_event_date-2171709-4.patch901 bytesArgus

Comments

Argus’s picture

Issue summary: View changes
Argus’s picture

Project: Open Atrium » Open Atrium Events
Argus’s picture

I suggest to use the date and time formats available:

    // Create an array of time / date information for ease of use.
    $dates = array(
      'start' => array(
        'time' => date_format_date($start_date, 'time'),
        'date' => date_format_date($start_date, 'long'),
      ),
      'end' => array(
        'time' => date_format_date($end_date, 'time'),
        'date' => date_format_date($end_date, 'long'),
      ),
    );
Argus’s picture

StatusFileSize
new901 bytes

Added a patch for that.

Argus’s picture

Status: Active » Needs review
Argus’s picture

Status: Needs review » Needs work

This doesn't work for the "time" part, that isn't a default Drupal available format.

Argus’s picture

Issue summary: View changes
Argus’s picture

Issue summary: View changes

typo

hefox’s picture

Project: Open Atrium Events » Open Atrium
Component: User interface » Events App
ikkyu’s picture

Sweet ! I was wondering where to customize the next upcoming date in Event Details view. I just changed the code with my own custom date format and now everything is displayed as it should. I'll have to modify the oa_events.module file after each Open Atrium updates until this is fixed but it will do for now. Thanks a lot Argus, you saved my day.

mpotter’s picture

ikkyu: Since the patch doesn't work for the Time portion as mentioned in #6, what did you do instead?

mpotter’s picture

Status: Needs work » Fixed

I committed a fix for this in oa_events 5f77b2d. I added config strings for specifying the date and time formats so you can set them as needed. The Drupal "long" format didn't match what we needed here.

ikkyu’s picture

Instead of using a drupal predefined format like the patch I just put my own custom date format like the original code.

...
        'time' => date_format_date($start_date, 'custom', 'G:i'),
        'date' => date_format_date($start_date, 'custom', 'l d F Y'),
...

So now I have the right french format for the date and the time.

mpotter’s picture

OK cool. In v2.60 you'll be able to just go to the Admin -> Open Atrium -> Config page and enter those values into the fields for events.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.