Since updating to EE 4.9.x (we’re now 4.9.44p), our event page ‘date & times’ are displaying strangely (i.e. 2017-09-09T16:00:00+00:00). Have checked WP and EE date format and localisation settings and can’t see anything obviously wrong. All other dates and calendar entries appear fine. This is just happening on the event page ‘date & time’ box. Any ideas please?
Thanks for the prompt response. Yes, the site was delivered by a third-party developer originally, so there’s likely some custom code that needs updating, if this isn’t core EE functionality. We’ll try and hunt it down.
Yep, looks like we’ve got some custom stuff in our template’s single-espresso_events.php, that’s now formatting the dates & times slightly differently:
<?php
/**
* Template used for event detail page
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Acton Aid
*/
global $post;
$post = get_post($post->ID);
$event_id = $post->ID;
get_header(); ?>
<!– Begin Content –>
<div class=”container”>
<?php while (have_posts()): the_post(); ?>
<section id=”content” class=”event-details”>
<?php
$event = EEH_Event_View::get_event($event_id);
Where you have code like this: $date = $date->get_date('DTT_EVT_start');
You can change it to something like this: $date = $date->get_date('DTT_EVT_start', 'M d, Y H:i');
(you can set the format to any compatible PHP date/time format to your needs) or even: $date = $date->get_i18n_datetime('DTT_EVT_start');
or even: $date = $date->get_i18n_datetime('DTT_EVT_start', 'M d, Y H:i');
In the future please post entire PHP files into a github gist or pastebin.
That’s sorted it! Many thanks for your help guys, really appreciate it.
(Apologies re: the code posting. I’m still learning the ropes with this)
Viewing 5 reply threads
The support post ‘Event page 'Date & Times' displaying as 2017-09-09T16:00:00+00:00’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.