-
AuthorPosts
-
March 19, 2019 at 5:41 pm #1080408
Hi,
I am importing Meetup events into TEC and worked with meetup import plugin developer to fix some timezone issues. Calendar and imports are working now, but it seems the ALB Events Countdown element is not detecting the correct times. It is seeing the next event as UTC instead of PDT. The “count” is 7 hours longer than it should be.Php.ini is set for Los Angeles/United States. WP is set for Los Angeles. TEC is using Sitewide tz. See bottom right at https://www.hikingwithdean.com/ (and next event under “Other Meetup Hikes”). Notice there is a 7-hour difference.
Background: Before I got the Meetup import plugin fixed, to display correct time for the events I had to set WP to UTC (hiding timezone label in TEC). That made TEC date change to tomorrow 7(or 8) hours early. At that point the counter was correct. Now that the events and TEC are correct, the counter is not.
March 23, 2019 at 5:00 am #1082070Hey Dean,
Sorry for the late reply, if I understand correctly you were working with a developer that was assisting with a timezone issue you were having in the events calendar plugin, after solving that you are now having a time zone issue in the events countdown element.
So this sounds like you need to adjust the events countdown element time zone independently.
I see that the config-templatebuilder > avia-shortcodes > events_countdown.php on about line 186 has $time = time(); which I believe can be adjusted to include a time zone using this code as a example
I’m not really good at that, but I’m sure your developer could adjust it. I hope this gets you going in the right direction.Best regards,
MikeMarch 23, 2019 at 5:11 am #1082071He’s not my developer, per se. He is the author of a plugin I am using. After nagging him about the imported events timezones he updated the plugin for everyone that uses it. It seems that the ALB events countdown element thinks the event time should be UTC and adds 7 hours to my Los Angeles time.
I don’t know enough to follow the examples
March 23, 2019 at 3:11 pm #1082125Hi,
Oh I see, I could give it a try. I think this might work:$time = time('h:i:s A', time()-25200);
which removes 7 hours, but I can’t test on my localhost because I don’t have the same setup as you.
If you post ftp access in the Private Content area I could try. If your webhost offers the staging site option it might be better so your visitors don’t see my trials and errors.Please check if your webhost has the one click staging site option, this is a option in most cPanels to create a staging clone of your site so we can test on it and you site will stay up and running. You can always ask your webhost to help you with setting this up if you want.
Here are some screenshots of what it would look like:
Best regards,
MikeMarch 27, 2019 at 3:09 am #1083353Hi,
Hey good news, the dev team told me they have worked on an option for the Animated Count Down to add TimeZones, it is a beta feature and they gave me the files to add it I think this might help with your issue.
If you can give me an admin login and FTP access I can add it to your site so you can test it yourself.
They said “the event start dates must be set to the correct timezone”.Best regards,
MikeMarch 27, 2019 at 8:07 pm #1083782Sounds interesting. Thanks!
- This reply was modified 5 years, 8 months ago by compudean.
March 28, 2019 at 5:24 am #1083917Hi,
Thanks for the FTP login, but I couldn’t login to WordPress. I went ahead and renamed the files that needed to be replaced with a “-old” on the end and uploaded the new ones. This is so we can roll back if you wish. I also checked your site to ensure it didn’t crash, but it still seemed to be running properly :)
Since I couldn’t login I’m not sure if this is working for you, but I tested on my localhost and it works.
You will now see a “Timezone” option in the Animated Count Down element:
Please select a timezone in the timezone selectbox that you wish to use, it can be different than the timezone WordPress uses in the WordPress > Settings > General > Date Format field and it uses UTC, you’ll just need to make the adjustment to suit.
Please be sure to clear your cache a few times as javascript files were replaced for this modification and they can be a little tricky to clear from the cache, also check any cache plugin and I see your host is using “LiteSpeed” so there is a cache on your server too.
Please let us know if this helps.Best regards,
MikeMarch 28, 2019 at 6:32 am #1083933Hi Mike,
That is not the element in question. I am referring to the Events Countdown. Its a Plugin Addition.
[av_events_countdown min='1' max='4' align='av-align-center' size='' title='bottom' style='av-trans-light-style' av_uid='av-2quprx' custom_class='']
I found your files at /enfold/config-templatebuilder/avia-shortcodes/countdown. I think we need to work on /enfold-child/shortcodes/events-countdown.php. That is where I was trying to insert you snippet
FYI – I tested the Animated Countdown and tz option is working there
*I fixed wp-admin login
March 28, 2019 at 1:54 pm #1084092Hi,
Both /avia-shortcodes/countdown & /shortcodes/events-countdown were updated.
I see the new timezone option is not showing on events-countdown element, but on the event page there was already a timezone option:
I believe the new events-countdown file is managed in that option, when I test changing this timezone it changes the
events-countdown.
Please try this.Best regards,
MikeMarch 28, 2019 at 2:40 pm #1084116All the events have the correct time zone when imported. As stated at beginning, when timezones were imported as UTC the counter appeared correct. But that is because the timezone was incorrect. Note I am saying “timezone” here, not the numerical time
Here is screen shot after your post. I noticed that the tz was set to utc-7 on this event (did you do that?)
Before the meetup import fix I would need to set wp timezone to UTC and hide the timezone label. The time would have shown as 5:00 pm [“UTC” hidden] and counter would show correct hours. Now that meetup event is imported correctly (all of them are Los Angeles or UTC-7 = PDT) the counter is 7 hours off.
It seems that the Event Countdown element is seeing the Event timezone as UTC when event is correctly set as Los Angeles (or UTC-7).
On the other hand, I realize that the meetup import plugin might be “faking? the timezone? Later today I will create some test events manually and see if countdown is correct — that may tell us the import plugin is doing something unknown to counter?
March 28, 2019 at 5:59 pm #1084204I did the test mentioned above and created an event manually. Results are the same — the Events Countdown element is adding 7 hours to the time it sees as event time. Thus, it does not appear import plugin is causing shift.
BTW, the modification of Animated Counter does not add a timezone option in Events Countdown popup settings. I can’t use the Animated Counter because I would have to manually enter “Future Date/Hour/Minute” for every next event, individually, as each event passes. The Events Countdown automatically resets time to next event as events pass.
Top is Events Countdown – bottom is Animated Countdown
- This reply was modified 5 years, 8 months ago by compudean.
March 29, 2019 at 4:15 am #1084454Hi,
Thanks for the screenshot and the explanation.Here is screen shot after your post. I noticed that the tz was set to utc-7 on this event (did you do that?)
I didn’t make any changes because I couldn’t login before, the screenshot was from my computer.
I was able to login today, so I created a test manual event so I could better document the error to explain to the dev team so that they can help.
So at the time of my test your time was 2019-03-28 17:52:05 in Los Angeles accourding to your time and date on your WordPress > Settings > General > Date Format, I also confirmed on Google, so I created an event about one hour in the future (7:00pm) and added a countdown timer to it
Then I published and viewed on the front end and the time on the countdown timer was correct (within the 3 minutes it took me to do this)
So after this I realized that I didn’t check the countdown timer on your homepage, so I did another one that was about 55 minutes in the future, here is the backend:
here is the front end:
and here is your homepage countdown timer:
So I’m not sure what I’m doing differently than you were when you tried to create a manual event and had gotten the 7 hour error?*please don’t worry I deleted the test events and they were only live for less than a minute.
While I was looking at the backend of your events I noticed that your event editor was showing the event rows as a column, this typically occurs when there is a plugin conflict. There could be other reasons, but there were no errors in the browser console.
But this didn’t seem to cause an error in the countdown timers that I created.Best regards,
MikeMarch 29, 2019 at 9:06 pm #1084731I created a 5pm event around 3:40 PDT and here it is….still getting 7 hour error
To create event, I just added title, dummy text and time. Nothing else was touched. I tried uncategorized vs categorized with no change.
The list of events is squashed due to added columns. Its not much noticeable with a wide screen. Yoast put some there I can get rid of
- This reply was modified 5 years, 8 months ago by compudean.
March 30, 2019 at 3:08 am #1084768i see you…let me know when you are finished
March 30, 2019 at 3:26 am #1084770Hi,
Strange, I found your event at 6:03pm, LA time, and since the event was past at that point, I changed the event to 6:30pm and it worked correctly:
I then thought that perhaps by me putting the start & end time of the event as the same it was thoughing it off so I changed the end time to 9:30pm, but it still was correct:
So I read the instructions from the dev team again looking for clues and they said:If you change the timezone on your computer it might be necessary to restart.
Do not forget to clear browser cache.Did you clear your cache? What time is your computer set to?
I will ask the dev team to take a look once I hear back from you because I don’t understand why I can’t recreate your issue on your site.Best regards,
MikeMarch 30, 2019 at 4:38 am #1084775I think you found it. I moved the time forward to 8:30 and the 7hr dif was still there. I cleared my browser cache and countdown became correct. I removed the test event and the next one in line has correct countdown :)
Strange that browser cache had incorrect tz. Recall from my early posts that I had wp set to UTC when the import plugin was not managing tz correctly. I wonder if wp caches that. I’ll do some research on that for completion sake.
Never thought that browser cache includes tz info. When I get back to office Monday I’ll clear cache there and see if solution repeats. Good job. Sorry I put you through all that after solution turned out so simple Thanks!
March 30, 2019 at 5:08 am #1084782Hi,
That is great! I’ll let the dev team know that it is working, I will also leave this thread open because since I modified your theme files updating the theme will break it, and unless this is added to the next update I will need to patch your files again.
We will see if it’s added to the update when it comes out.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.