Support

Home Forums Event Espresso Premium Sidebar widget, EE4, time format

Sidebar widget, EE4, time format

Posted: January 8, 2015 at 2:29 am

Viewing 6 reply threads


Ray

January 8, 2015 at 2:29 am

Hi

I couldn’t figure out where to change the time format for the sidebar widget: showing upcoming events.
We have am/pm and want European time format e.g. 18:00 instead of 6:00 pm.

Thanks
Ray


Dean

January 8, 2015 at 3:10 am

Hi,

Currently the date format is hard coded, but as of 4.6.0 the date format will follow WordPress date settings.


Ray

January 8, 2015 at 3:24 am

Thanks Dean. Thats hilarious 🙂
Any rough timeframe on the release – days, weeks, months?

Need to decide if its worth coding or to wait.

Thanks


Dean

January 8, 2015 at 4:02 am

Yeah I understand and sorry about that. It was an oversight on our part, but as with everything it has to go into a set procedure for release, otherwise internally things will get messed up and potentially broken (we do a lot of commits!).

I can’t give an exact timescale as I am simply not sure. EE4.5.0 has to come out first, and that is hopefully going to be soon as it is in beta and has very few tickets left for it, so I would put 4.6.0 into the weeks stage at a minimum.

Looking at the code for 4.6.0 there will also be some filters available to swap the date format in the widget should you need it to be different to the rest of the date formats.


Ray

January 8, 2015 at 5:50 am

Ok. I understand..
Then I need to override the function somewhere. Can you tell me where and maybe how?

Thanks


Dean

January 8, 2015 at 6:23 am

Hi,

The only way I can see is via a core hack.

/wp-content/plugins/event-espresso-core-reg_448/widgets/upcoming_events/EEW_Upcoming_Events.widget.php

line 290 should say

´echo espresso_list_of_event_dates( $event->ID(), ‘D M jS, Y’, ‘g:i a’, FALSE, NULL, TRUE, TRUE );´

The ‘D M jS, Y’ (date) and the ‘g:i a’ (time) need to be changed to the correct date formats

So for 24 hour clock style, the time would become:

‘H:i’

http://php.net/manual/en/function.date.php


Ray

January 8, 2015 at 6:45 am

Ok. That works.
Thanks for your support. 🙂

Keep up the good work
Ray

Viewing 6 reply threads

The support post ‘Sidebar widget, EE4, time format’ 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.

Event Espresso