I'm trying to filter events with a start date greater than today. I'm using the field _EventStartDate (I also tried _EventStartDateUTC).
This doesn't work:
Select items with field: _EventStartDate is a UNSIGNED greater than TODAY()
I've tried everything (I think) for the type. I expected that "UNSIGNED" would work - but it returns no results.
Here's the test page: hidden link
It's the block of four at the top. You'll see I have two event that are past, and two in the future. I only want to show the two in the future (formatting to follow, of course).
The problem is the format the Events Calendar stores its date fields in (screenshot).
Types date fields are stored as UNIX timestamps, and when you use something like TODAY() in a filter that generates a timestamp for the comparison (expecting the comparison to be against a Types date field).
You can create a custom shortcode which will return today's date in the same format as the Events Calendar, and in your Query Filter for the event date specify that the filter value should come from a shortcode attribute.
Then, where you insert the View—using a wpv-view shortcode—add that attribute where the value is set by your custom shortcode.
You'll likely need to register this 3rd party shortcode for use as a shortcode attribute at Toolset > Settings > Front-end Content.
While I understand the issue now (and its what I suspected), what I don't know is how to "create a custom shortcode which will return today's date as the Events Calendar."
To be able to pull date parts (month and day), I used this, which I found in Toolset support archives:
I did not - and that was the final trick in this bag of tricks!
I think it's working for me now. Thanks for your help!
I may put together a tutorial on this. I spent a day looking for ways of getting The Events Calendar in a simple format I wanted, e.g. using premium plugins. I had what I needed all along - I just didn't see it (starting with the _hidden-fields thing).
Actually, one more question: Is there a way to offset the query/filter results by a specified number.
Depending on the formatting challenges (and being pressed for time) I was thinking of duplicating the query but have one view show just the next event and then the second view show the event after that.