Home › Forums › General Issues › If DatePicker date is less than 1 year old › Reply To: If DatePicker date is less than 1 year old
Ah! Thank you. That helped me figure it out. Here is my solution to show a dot if file is less than 6 months old:
$age = strtotime( get_sub_field('file_date'));
$now = strtotime("now");
<span class="age"><?php if ($now - $age < 15778800) { echo "<i class='fas fa-circle'></i>"; }?></span>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.