Home › Forums › Add-ons › Repeater Field › How do I query a repeater which uses recurring dates? › Reply To: How do I query a repeater which uses recurring dates?
are you sure about the compare?
it should only show dates that are currently ongoing (have a startdate today or inside the past, and a enddate of today or the future.)
you could do it after query with php with code like that:
<?php
$today = date('Ymd');
$start_date = get_field('start_date');
$end_date = get_field('end_date');
if ((strtotime($today) >= strtotime($start_date)) && (strtotime($today) <= strtotime($end_date))) { //echo or something you like to do with the dates
}
?>
else, if you still need/wish to work with meta_value i can help you only with this info:
date of datepicker inside DB is always build like 20150513 year month day without spaces, no matter what input or output format you give the date field with acf settings for that field.
i am not sure if your $today has the same format/value. hope that help you to solve your problem.
of your example dates it could only show the first (even if you would correct the 2051 to 2015)
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.