Issue with Timezones and All Day Events, cont

Home Forums Calendar Products Events Calendar PRO Issue with Timezones and All Day Events, cont

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1421330
    Marco
    Participant

    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!

    #1422984
    Andras
    Keymaster

    Hey 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,
    Andras

    #1423950
    Marco
    Participant

    Hi 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,
    Marco

    #1424473
    Andras
    Keymaster

    Hi 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,
    Andras

    #1426718
    Marco
    Participant

    Hello,

    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 imports

    Same problem 🙁 Everything is still in UTC.

    Regards,
    Marco

    #1427319
    Andras
    Keymaster

    Hi 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,
    Andras

    #1427321
    Andras
    Keymaster

    This reply is private.

    #1427638
    Marco
    Participant

    Andrá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,
    Marco

    #1428312
    Andras
    Keymaster

    Hi 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,
    Andras

    #1434056
    Marco
    Participant

    I’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!!

    #1434405
    Andras
    Keymaster

    Happy 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,
    Andras

    #1454269
    Support Droid
    Keymaster

    Hey 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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Issue with Timezones and All Day Events, cont’ is closed to new replies.