Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter imcheery

    (@imcheery)

    @atousanajafi, I know it. That is why I tried to describe the problem in more details. When the end time passes, the event disappears from the Upcoming (which is correct), but does not appear in the Latest Past Events list until the next day (because the view selects the events ended before the beginning of the current day).

    Event if I modify the repository argument ends_before as current time, in case of a single upcoming event, the Latest Past Events list won’t appear until the local time passes the UTC end time of the event. OK, I made the screenshots although the code is obvious by itself.

    Sample Event starts at 11:00 am, ends at 11:30 am EST. At 11:29 am the Event is still in the Upcoming list (OK)
    https://i.ibb.co/psGDm6j/upcoming.png

    At 11:30 am it disappears from the Upcoming, but the Latest is not shown (not OK)
    https://i.ibb.co/S70vR58b/default.png

    It happens because $now in View.php contains string 2025-12-25 11:30:26 (local EST time), while $latest contains 2025-12-25 16:30:00 (the UTC end time of the event) and the Latest view won’t be loaded for the next 5 hours. Even if I remove the condition, the Sample Event won’t be in the list as its repository argument ends_before uses the midnight of the today’s date, not the current time.
    https://i.ibb.co/PGRmjs5z/Views-fix.png

    $args['ends_before']    = current_time( 'mysql' );

    provides the expected result
    https://i.ibb.co/mFYXnwBQ/Latest-List-fix.png

    Thread Starter imcheery

    (@imcheery)

    Hi @d0153

    1) Fresh WP
    2) Astra Theme + The Events Calendar plugin + 1 future event
    3) Customize header, add Widget 1 with the Events List block into menu in Desktop view, add the same Widget 1 into the Mobile view. Both will be present on the same page at the same time (only one is visible) with the same UUID in data-view-breakpoint-pointer attribute.

    Result:

    Uncaught SyntaxError: Unexpected non-whitespace character after JSON at position 5265 (line 2 column 2)
    at JSON.parse (<anonymous>)
    at Object.setup (breakpoints.statopt_ver.1765957124.js:1:1382)
    at HTMLDocument.initBreakpoints (s-qgzw3lyh9g79/:253:42)

    and

    Uncaught SyntaxError: Unexpected non-whitespace character after JSON at position 5265 (line 2 column 2)
    at JSON.parse (<anonymous>)
    at Object.setup (breakpoints.statopt_ver.1765957124.js:1:1382)
    at HTMLDocument.initBreakpoints (s-qgzw3lyh9g79/:423:42)
    • This reply was modified 5 months, 3 weeks ago by imcheery.
    Thread Starter imcheery

    (@imcheery)

    No, I can not – it is not public yet.

    I looked closely into the problem, only multiple same widgets on the same page create this problem, not the calendar itself.

    I added the widget with featured events to the header of the Astra theme, which doubles them for desktop and mobile version. Browser console showed a couple of errors related to the JSON parsing. Looked into the HTML code, found that every widget (2 in total) adds it’s own code (cut to reduce space):

    <script data-js="tribe-events-view-data" type="application/json">
    {"slug":"widget-events-list","prev_url":"","next_url":"","view_class": ..</script>

    Two same errors are in the console: Uncaught SyntaxError: Unexpected non-whitespace character after JSON at position 5149 (line 2 column 1) because variable s is an array with 2 same elements. The code s.text() combines them into invalid JSON string {...}\n{...}

    Two errors are due to the same javasript code for widgets inserted twice – function initBreakpoints:

    var container = document.querySelectorAll( '[data-view-breakpoint-pointer="UUID"]' );
    if ( ! container ) { return; }
    window.tribe.events.views.breakpoints.setup( container );

    container has 2 elements in array as there are two same DIVs with the same data-view-breakpoint-pointer

    • This reply was modified 5 months, 3 weeks ago by imcheery.
Viewing 3 replies - 1 through 3 (of 3 total)