Posted: July 12, 2013 at 8:09 am
|
Hello, I searched the forums and couldn’t resolve my issue, so hopefully you can help. We run webinars that are always set at 1:00 – 2:00 pm Eastern (although we are located in Salt Lake City). I’ve gone through the start up documentation and setting up an event seems pretty easy. I’ve entered all the needed criteria and set the start time at 1 pm and the end time at 2 pm. It occurred to me that the system must think I mean that time to be for the Mountain Timezone, so I’ve set it to allow me to have a custom timezone for the event, which I set to New York (to account for the Eastern Timezone). After doing so, it seems nothing has changed. It still says 1 pm to 2 pm for the event on the actual registration page. This is fine for people in the Eastern Timezone, but for someone in the Mountain Timezone it should be 11 am to 12 pm. Does that make sense? Am I not understanding how this works correctly? If not, could you help me achieve my goal (set a start time for the Eastern Timezone and have it show correctly in the timezone you are in)? Thanks in advance. Edit: I’m running Espresso version 3.1.33.3.P (no add-ons) Installed Plugins Akismet by Automattic version 2.5.8,
|
Hi Desmond, The custom timezone feature isn’t designed to display the start time of the event based on the user’s time zone. In a nutshell it is designed to allow for managing events in different timezones. It does not by default alter the way times are displayed on the registration form. Making it change the times that are displayed on the fly (based on the time zone settings of the device the visitor’s browser is using) would require some custom development. The first step would be to add some JavaScript to the registration page that detect’s the device’s time zone setting. There are ready made scripts out there that can be used. Here is one example: https://github.com/scottwater/jquery.detect_timezone The a script could be added to replace the time that’s displayed on the page with the custom value. This would take some time and development resources to accomplish this customization, which isn’t something we can offer via the support forums. A simpler solution that I can help you with is to change the start time & end time labels so that they specify the actual time zone the times are set to. If you open up the custom-files add-on’s custom_functions.php or your current WP theme’s functions.php you can add this code to change the labels to display the abbreviation for Eastern time: function mycustom_filter_gettext( $translated, $original, $domain ) { // This is an array of original strings // and what they should be replaced with $strings = array( 'Start Time:' => 'Start Time: (ET)', 'End Time: ' => 'End Time: (ET)', // Add some more strings here if you'd like ); // See if the current string is in the $strings array // If so, replace it's translation if ( isset( $strings[$original] ) ) { // This accomplishes the same thing as __() // but without running it through the filter again $translations = &get_translations_for_domain( $domain ); $translated = $translations->translate( $strings[$original] ); } return $translated; } add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 ); Alternatively, if you really wanted to modify the display of how the times get displayed you could edit the markup that’s in event-espresso/includes/functions/time_date.php that starts on line 204. |
|
|
Thanks Josh, you really helped clear things up. I won’t pretend to know much what I’m doing with PHP or Javascript (although I’m quite comfortable with CSS and HTML). What I’ve opted for is your very last suggestion “Alternatively, if you really wanted to modify the display of how the times get displayed you could edit the markup that’s in event-espresso/includes/functions/time_date.php that starts on line 204.” So what I have done is the following: <pre class=”brush: php; gutter: true; first-line: 1; highlight: []; html-script: false”>if ($wpdb->num_rows == 1) { Basically all I did was add the word ” Eastern” to both the start and end times. Does this look ok? Again, I really am just making an educated guess as to where I should insert “Eastern” (although it seems to be working on my registration page). If this looks good to go, I have a few questions: – This really is just cosmetic so it won’t affect my Registration Start and End times right? If that is the case, then the Registration Start and End times that I input are based off my actual timezone (Denver being the case), correct? Or can I set the custom time-zone to New York (Eastern) and the Registration Start and End times will be based off that? – I assume with any plugin updates, I’ll have to reinstate the changes I’ve made? – Is this the most simple solution? Really all I need is for someone to visit the page, see that the webinar starts at 1:00 – 2:00 pm Eastern, then register based off that knowledge. Sorry for the questions or if I’m not thinking it through correctly. Thanks again. |
Hi Desmond, The code you posted looks good to me. I’ll follow up with your follow up questions:
It is a cosmetic change. To be honest, it will display the times to enter and I don’t think it will factor in the timezone set below it. From what I can tell is the timezone selector is for event managers usage to keep track of events that happen on different time zones. – I assume with any plugin updates, I’ll have to reinstate the changes I’ve made? You can actually copy this function into the custom_functions.php file and it will load from there. So if you download the custom files add-on and upload the custom_functions.php file to /wp-content/uploads/espresso/ you can run your modified code from there. Here’s how this works: If you look at the beginning of the event_espresso_time_dropdown function there’s this line: if (!function_exists('event_espresso_time_dropdown')) { This means it’s pluggable and you can override it. To do that copy the entire modified function starting with the above line and down to its closing } to custom_functions.php. Then when you update, it will continue to run. This isn’t a function that gets changed often, but if for some reason it gets changed in a future version your custom function will need to be updated too.
I think it’s a good solution. One thing that I thought about with the idea of displaying the device’s time zone would be it could confuse people. For example, if I’m out on the West coast one and making plans to attend this event, the event time will display as my local time at that moment, which could get confusing. |
|
|
Awesome. Thanks for the response. I could see how time-zone settings could get confusing — I suppose its a series tradeoffs (and maybe I’m in the minority in that I’m using this software exclusively for webinars). Thanks again, have a great weekend. |
The support post ‘Timezone issue?’ 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.