Posted: August 25, 2015 at 6:10 am
|
Is there a way of formatting the date-times differently for multi day events. Currently for a event spanning several days, beginning May 11, 2016 at 6pm and finishing on May 15, 2016 at 2pm it is reading thus on the event: May 11, 2016 – May 15, 2016 The times here, are getting visually disconnected from the dates This looks really strange – May 11, 2016 – May 15, 2016 is fine Can it be made to show May 11, 2016 at 6:00 pm – May 15, 2016 at 2:00 pm? Any suggestions? Example here
|
Hi Alan, That event is password protected so we can’t see it currently. However I’m guessing you are referring to the datetime list here – http://take.ms/L5BxN |
|
|
Hi Tony Exactly that – I forgot my event is private but this is a screenshot
In your example it looks like the event is happening between 8am-5pm each day between 27th and 29th My event is a residential meditation retreat where people are arriving May 11, 2016 at 6pm and the retreat concludes at 2pm on May 15, 2016 However the way that EE renders it is completely wrong. Can this be fixed using CSS maybe? |
|
I found my answer here Bev Hoernig’s solution at the bottom gives the formatting as March 5, 2016 12:00 pm – August 9, 2017 12:00 pm – which is ideal |
Apologies for the delay, I’m glad you’ve found a solution. I’m assuming you’ve added that to your themes functions.php file or a Site Specific Plugin so it isn’t lost on updates? |
|
|
thanks – I added it to a plugin, however on a German version of the site it converts the month names to English unfortunately Any idea what i might tweak to avoid this? |
Hi Alan, Can you let me know which month names get translated to English on your site? I checked a site I have set up with the German language and added your code to reformat the dates and it turns out the month names are printed in German. |
|
|
Hi Josh – I noticed that when the event was using the German month “Mai”, the English translation “May” was used – and this seemed to happen for all events. What code did you use? Maybe I could try that instead… |
|
“this seemed to happen for all events” = meaning the English months and days were used |
Hi Alan, are you seeing this issue with Dean’s example as well? — |
|
|
Dean’s Example doesn’t work for me – it doesn’t put the date and time on the same line, which is what Bev Hoernig’s solution achieves. I made it into a plugin but this is what the formatting looks like – all it does is put xxx in front of the date: xxxSeptember 12, 2016 – September 16, 2016 With the German Version it looks like this: xxxMai 11, 2016 – Mai 15, 2016 |
Hi Alan, I used Bev’s code from the other thread that you linked to. Here’s a copy I made into a gist: https://gist.github.com/joshfeck/9fe4b64da02f042e52b4 I checked again for an event for the month of the May and it has the translated month strings: I’m curious about how it’s not translating for you, does the translation start working if you remove the custom code? |
|
|
Hi Josh Tried your gist in a plugin – it reformatted the dates OK but put them into English. When I disabled the plugin, it went back to German dates instead. Would it make any difference that I am have a multisite installation? |
It may be contributing. It seems like it’s a load order issue where possibly your custom function is somehow loading before translations get loaded. You could try adding the function to the end of the active theme’s functions.php file to see if that makes a difference. |
|
|
Thanks – I tried that but it still comes out with the formatting OK but not translated. It’s not such a big deal. Thanks for trying to help. Will you correct the formatting in this way in a future release of EE? |
I don’t think we’ll change the template tag, but it turns out that Event Espresso has another template tag that uses the format you want to be used. You can use the other tag by copying the content-espresso_events-datetimes.php template from Event Espresso’s /public/Espresso_Arabica_2014 folder into your WordPress theme and then edit your copy where you change the line that reads as:
to this:
-or- You can change the function in your functions file to simply be:
|
|
|
Absolutely Perfect!!! – those two lines of code do the trick perfectly Many many thanks! Great Support! |
The support post ‘Date-Time formatting for multi day events’ 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.