I am trying to show only events that are upcoming, this is working great:
&tvFilters=`eventEndDate>=[[!getDate:date=`%Y-%m-%d`]]
but, some of my events do not have an eventEndDate as they are only one day. Is there any way I can add if/else logic to the tvFilters pram ? e.g
if EventEndDate is Empty: eventStartDate>=[[!getDate:date=`%Y-%m-%d`]
else: eventEndDate>=[[!getDate:date=`%Y-%m-%d`]
thanks I tried using output modifiers, but I don't think getResources can handle them:
&tvFilters=`[[*eventEndDate:empty=`eventStartDate>=[[!getDate:date=`%Y-%m-%d`]]`:else=`eventEndDate>=[[!getDate:date=`%Y-%m-%d`]]`]]`
Sorry I hadn't read your post correctly! Your right &tvFilters won't handle that. TBH not sure it will be able achieve what you want full stop.
Could you not duplicate the start date for the end date as well, so a one day event starts and ends on the same day?
Yes, I think this is what I will have to ask the client to do, always supply an end date. Is there anyway to programmatically populate a TV, or maybe by default use the value of the start date?
Yes you just add [[*eventStartDate]] as the default value for the end date tv
that would not work, because the start date has to be set first...
Yes, but if you use the start date it will be removed 1 day after that date, even if it is say a 4 day event.
Not sure I understand what you mean. If it is a 4 day event then the default value will not be used as you would have entered a different end date for the event.
The default value of [[*eventStartDate]] would only be used if you don't set a value in the [[*eventEndDate]] tv field in your event resources. Basically every event would be a one day event unless you set a value for [[*eventEndDate]].