I am trying to create a function in php where i check for the events date and if it less than todays date, then show no events. And if it is greater than todays date, display the date.
This is my php function
function todays_date($date)
{
$date_now = time();
}
function event_start_date($id)
{
$startDate = strtotime(get_field('event_start_date', $id));
$date = date('U', $startDate);
return $date;
}
and the in twig im checking to see if the dates are greater than one another in order to do something else
{% set date = function('event_start_date', item.id)|date('M d') %}
{% set today = function('todays_date')|date('M d') %}
{% if date < today %}
<p>No events found.</p>
{% else %}
<p class="date">{{ date }}</p>
im not sure what i am doing wrong.