Home › Forums › Calendar Products › Events Calendar PRO › Issue with Timezones and All Day Events, cont
- This topic has 12 replies, 2 voices, and was last updated 6 years, 2 months ago by Marco.
-
AuthorPosts
-
January 9, 2018 at 7:53 am #1421330MarcoParticipant
I would like to continue the post here:
https://theeventscalendar.com/support/forums/topic/issue-with-timezones-and-all-day-events/This is still not working. I think the point was being missed.
I want the imported events to display in EST, not UTC. But if I do so by changing the timezone mode settings, it breaks “All Day Events” — I feel like I didn’t make this clear enough in my last post.
It’s not two problems I need solved, it’s one:
My incoming feed must be forced to use the sitewide timezone using the Timezone mode settings because the iCal feed entries with times come in as UTC but in doing so it breaks “All-Day” events.All-Day events do NOT come in with a timezone on the iCal feed. They simply show they’re for that day: I showed examples of this in my previous post as well as links to the iCal feed.
The problem is, as far as I can tell, The Events Calendar assumes they’re all day events with specifics times (12am to 11:59pm) in UTC and when I change the timezone mode to “sitewide” it changes All Day Events to span two days (9pm to 8:59pm or something like that) which totally messes up the calendar and confuses my users.
Unfortunately, doing nothing is just as confusing as all my times are in the wrong timezone!
January 10, 2018 at 1:25 pm #1422984AndrasKeymasterHey Marco,
I’m sorry about your troubles with this import.
I ran some quick tests but will need more time to nail down if there is an issue or not.
For sure if the timezone was defined for all events, then they would be imported properly.
You would either need to define the timezone at the beginning of the file like this:
X-WR-TIMEZONE:America/New_York
or define the dates / times of the events like this:
DTSTART;TZID=America/New_York:20170905T190000
Meanwhile though I can share with you the below snippet, which could help your problem. I haven’t tested it with your source URL but had a user who used this successfully.
https://gist.github.com/andrasguseo/c895e4a7755055c18148b5bbd482c1dd
Please check and let me know if it helps.
Cheers,
AndrasJanuary 11, 2018 at 11:36 am #1423950MarcoParticipantHi András,
Thank you- I will try this out. Can you tell me where I put this code/file?
With regards to the first part of your message; I’m not able to edit the incoming feed.
Regards,
MarcoJanuary 12, 2018 at 2:56 am #1424473AndrasKeymasterHi Marco,
Copy the code into the functions.php file of your theme (preferably child theme).
Make sure to adjust the end of the code (line 72-78) according to your needs.
Eagerly waiting to hear if it works.
Cheers,
AndrasJanuary 15, 2018 at 11:08 am #1426718MarcoParticipantHello,
I followed the instructions and changed those last lines:
modify_imported_event_timezones(
‘null’,
‘America/New_York’
);…entered the full file into functions.php
…deleted all imported events
…re-ran the importsSame problem 🙁 Everything is still in UTC.
Regards,
MarcoJanuary 16, 2018 at 1:07 am #1427319AndrasKeymasterHi Marco,
Two things I noticed here.
When you deleted all imported events, did you also remove them from the ignored list? (screenshot)
The null in the code must not be in quotes, rather like this:
# Set the first param to null to operate on all import sources
Update the second param to the desired timezone (it must be
a valid timezone supported and understood by your PHP runtime)
modify_imported_event_timezones(
null,
'America/New_York'
);Try this and let me know if that does the trick.
Cheers,
AndrasJanuary 16, 2018 at 1:08 am #1427321AndrasKeymasterThis reply is private.
January 16, 2018 at 8:47 am #1427638MarcoParticipantAndrás,
This wasn’t able to solve my issue.
It fixed the time, left the timezone as UTC, but now “All Day Events” extend to two days instead of just the day they’re supposed to be for.
Regards,
MarcoJanuary 17, 2018 at 2:47 am #1428312AndrasKeymasterHi Marco,
I adjusted the above snippet so that the times are not changed for all-day events, but it still gets the new timezone.
Try it with that one. Don’t forget to change the feed to null again after pasting it.
I tested it with your feed and seemed to work. Let me know if it works for you as well.
Cheers,
AndrasJanuary 23, 2018 at 2:08 pm #1434056MarcoParticipantI’m waiting for confirmation from all parties involved but this looks like it did the trick! At least as far as I can tell 🙂
Thank you so much, András!!
January 24, 2018 at 2:07 am #1434405AndrasKeymasterHappy to hear all seems to be working fine!
I will leave the thread still open so you can get back to me after you received feedback. Keeping my fingers crossed. 😉
Cheers,
AndrasFebruary 15, 2018 at 8:36 am #1454269Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Issue with Timezones and All Day Events, cont’ is closed to new replies.