I am using the Grid field built into EE, 2.8.1, to display event dates. In the Grid column I have an event date field to let you know when the event starts. What I would like to do is have this date field then somehow have the field no longer display 24 hours after the event start time.
I got this working by setting up an expiration date field but thought it would be easier for the end user not to have to fill that in since it is not the best workflow for the data entry person.
Is there a certain way to automagically do this?
Here is my current template code. I am using the Math Plus plugin to help with math but not sure if I am even approaching this correctly.
{bio_pull_in_tour_dates}
<tbody>
{bio_pull_in_tour_dates:tour_dates orderby="bio_pull_in_tour_dates:tour_dates:tour_date_of_show" sort="asc"}
{if {bio_pull_in_tour_dates:tour_dates:tour_date_of_show format="%U"} < {exp:math_plus decimal_places="0" calculate="({var1} + {var2})" var1="{bio_pull_in_tour_dates:tour_dates:tour_date_of_show format="%U"}" var2="86400" }{math_plus_result}{/exp:math_plus}}
<tr>
<td class="col-md-2">{bio_pull_in_tour_dates:tour_dates:tour_date_of_show format="%n/%j/%y"}</td>
<td class="col-md-2">{bio_pull_in_tour_dates:tour_dates:tour_venue}</td>
<td class="col-md-2">{bio_pull_in_tour_dates:tour_dates:tour_city}, {bio_pull_in_tour_dates:tour_dates:tour_state}</td>
<td class="col-md-2">{bio_pull_in_tour_dates:tour_dates:country}</td>
<td class="col-md-4">
Start Time: {bio_pull_in_tour_dates:tour_dates:tour_date_of_show format="%U"}<br/>
Current Time: {current_time format="%U"}<br/>
Expire Time: {exp:math_plus decimal_places="0" calculate="({var1} + {var2})" var1="{bio_pull_in_tour_dates:tour_dates:tour_date_of_show format="%U"}" var2="86400" }{math_plus_result}{/exp:math_plus}<br/>
<br/>
{bio_pull_in_tour_dates:tour_dates:tour_additional_info}
<br/>Marked Expire </td>
</tr>
{/if}
{/bio_pull_in_tour_dates:tour_dates}
</tbody>
{/bio_pull_in_tour_dates}
So I am taking the date of show field converting it's format to Epoch seconds. Then I am comparing the start time to the sum of the start time plus 86400 since that is how many seconds are in a day. this should work but it does not appear to do so.
I hope this makes sense. If there are better ways to get the row to hide after a certain amount of time please point me in the correct direction,
thanks in advanced.