I've got a feed on a homepage using views that displays the event title/date - however the date displayed is showing one day earlier that it actually is, any idea why this could be happening?
Not sure what I can do about this as the issue is being caused by this shortcode here.
[tribe_formatted_event_date format="jS F" timezone="Europe/London"]
I would recommend contacting the The Events Calendar team in order to get this resolved. Even adding the shortcode itself to the page in the link below also produces the wrong date.
If there is a workaround to not display the 'tribe_formatted_event_date' code I'm more than happy to work with that. I currently have the ordering of the of the events by the start date (see attached screenshot).
So if there is anything you can give me to add to display the date in (jS F) format - i.e 20th March - that would be great.
I've created a custom shortcode to format the date for you after getting the raw date information from the database.
Here is the shortcode below.
// Add Shortcode
function cust_format_date( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'date' => '',
'format' => '',
),
$atts
);
// Creating timestamp from given date
$timestamp = strtotime($atts['date']);
// Creating new date format from that timestamp
$new_date = date($atts['format'], $timestamp);
return $new_date;
}
add_shortcode( 'cust_format_date', 'cust_format_date' );
The shortcode that is generate is [cust_format_date date="" format="jS F"] . I retrieved the date raw information from the database using this shortcode here [wpv-post-field name='_EventStartDate'] which is a shortcode created by Types.
Finally I've added this to your view.
[cust_format_date date="[wpv-post-field name='_EventStartDate']" format="jS F"]
Please let me know if your dates are now displaying correctly.