Home › Forums › Backend Issues (wp-admin) › Restrict datepicker ending date by starting date › Reply To: Restrict datepicker ending date by starting date
Hi @yarongo
The datepicker uses jquery UI datepicker and you can update the minDate and/or maxDate values like this:
//This is an example field key. You need to use your own
jQuery( '.acf-field-54cfe68700b24 .acf-date_picker input.input' ).datepicker( 'option', 'minDate', date.format() );
so if you target a change in the first datepicker, find out the value set and use it to set the minDate with the above code it should work. I’ve done something similar before myself 🙂
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.