• We have several custom event displays on our website built with the CCS plugin and the Tribe Events Calendar post type, categories, and fields. We are currently running TEC 5.9.1, and I have been testing the 5.10.0 update on our dev site.

    When I built these queries initially, the core TEC query was upcoming events and I had to use the display=custom attribute, which had Eliot added specifically for this, to overcome this. This must have changed in 5.10.0, because a list of current exhibitions (page link) that is just filtered with _EventStartDate < today will display EVERY past exhibition with the updates applied.

    Most of the changes I have figured out, but I’m stuck on one issue – including the first day of multi-day events in a “current” list. I need the list to go from _EventStartDate is today or before to _EventEndDate is today or after, but events won’t display until AFTER the first day.

    The CCS date specs that are working with _EventStartDate and _EventEndDate are future, past, and compare=more (=future) or compare=less (=past) plus value=today. ‘value=today’ without a comparison, or with compare=equal, doesn’t work. More complex date callouts in CCS (eg ‘past and today’) don’t work. So I also can’t pull a display of today’s events only.

    I know that ‘today’ is pulling the correct date, I can display it. I know that I am specifying the correct date formatting for TEC (Y-m-d), because this is the format spec that makes ‘future’ and ‘past’ work. In case there is something about the word “today” which conflicts, I set a variable called ‘dayness’ = today’s date and passed that to the query. That generates the correctly formatted date but didn’t work in the query either.

    Here’s the basic loop that works great EXCEPT for the missing started today events:
    [loop type=tribe_events field=_EventStartDate date_format=’Y-m-d’ value=past field_2=_EventEndDate date_format_2=’Y-m-d’ value_2=future]
    [field _EventStartDate date_format=’F j’] – [field _EventEndDate date_format=’F j Y’]: [field title-link]
    [/loop]

    If anyone has any suggestions, please let me know!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you create a var for your date with _EventStartDate + 1as value for start and _EventEndDate - 1 for end you can use them and compare=more or compare=less to get the result you are looking for.

    Thread Starter petroglyphic

    (@petroglyphic)

    Seems like a great idea, but I can’t get today+1 to calculate. If I use today+1 it calculates as today. If I use ‘today + 1’, ‘today + one’, or ‘today plus one’ the shortcode doesn’t work at all.
    I have been able to generate the correct Unix timestamp number by turning today to Unix and then adding 86400 (seconds in a day), but I can’t get the result back into the required Y-m-d date format:
    [set tday][today format=U][/set][pass vars][set nday][calc]{TDAY} + 86400[/calc][/set][/pass][get nday date_format=Y-m-d]
    gets the the correct timestamp but doesn’t convert the number back to date.
    Trying to do this on one step ([set vday][calc]’today format=U’ + 86400[/calc][/set][get vday format=date]) doesn’t work at all.
    Any suggestions much appreciated!

    to get today into a var try

    [set my_var][today format=U][/set]
    [calc] my_start = my_var +  86400[/calc]
    • This reply was modified 3 years, 4 months ago by polarracing.
    • This reply was modified 3 years, 4 months ago by polarracing.
    Thread Starter petroglyphic

    (@petroglyphic)

    That for me just prints ‘[calc] my_start = my_var + 86400[/calc]’ to the page. ‘[set tday][today format=U][/set][pass vars][set nday][calc]{TDAY} + 86400[/calc][/set][/pass][get nday date_format=Y-m-d]’ generates the correct UNIX date, but I can’t get it back to ‘Y-m-d’ format. Y-m-d is the only format that TEC recognizes.
    Thanks, Susan

    Try:
    [format date=Y-m-d in=timestamp][get nday][/format]

    if needed set this into a new var.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Event Calendar 5.10 and today’s date’ is closed to new replies.