I have a custom module that invokes the civicrm_buildForm hook to set the default date for a given field to today's date.
It is working - in part. When I examine the code I see that the default value is set. However, it is set in the input that is hidden. Whereas there is a second input that is displayed using what appears to be a randomly generated id (dp1479931180679) which seems to be created by the date picker widget.
If you leave the field blank, the default date is picked up and works. But it's a usability issue since it doesn't appear to be filled out to the user.
Anyone have a work around?
Here is what the html code looks like:
<span class="crm-form-date-wrapper">
<input id="custom_17" class="crm-form-text required crm-hidden-date" data-crm-custom="Constituent_Info__Individuals:Date_Started" data-crm-datepicker="{"date":"mm\/dd\/yy","minDate":"1986-01-01","maxDate":null,"time":false}" name="custom_17" value="11/28/2016" style="display: none;" type="text">
<input id="dp1480365364891" class="crm-form-text required crm-form-date hasDatepicker" style="" type="text">
</span>
The first input (which properly shows the right value) is hidden. The second one, which is the one displayed, doesn't have a value set.