I have two DatePicker fields and I have code to set minDate for the second one so that it cannot be earlier than the first. The code is at: https://www.damiencarbery.com/2020/06/acf-date-picker-set-end-date-to-after-start-date/
I am rewriting the JS so that it sets minDate on page load instead of waiting for the first DatePicker to be changed.
I am using the ACF JS API:
acf.addFilter('date_picker_args',.....
and
datepicker_value = args['altField'][0]['value'];
Is args['altField'][0]['value']
the right way to get the field value?
It seems a little hacky. I don’t see an API function in https://www.advancedcustomfields.com/resources/javascript-api/ to get the value.