-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
I have the following field definition for a front-end form:
$cmb->add_field( array(
'name' => 'Date',
'id' => 'date',
'type' => 'text_date',
'date_format' => 'j/n/Y',
'default' => date( 'j/n/Y' ),
'attributes' => array(
'required' => 'required',
'data-datepicker' => json_encode( array(
'defaultDate' => null
)),
),
'classes' => array( 'required' ),
) );
Neither the 'default' param or the jQuery UI 'defaultDate' param seem to pass anything through ('null' is supposed to default to today: https://api.jqueryui.com/datepicker/#option-defaultDate).
The datepicker works fine, inserts in the right format. And if I just change the type to 'text', the default date appears OK.
Metadata
Metadata
Assignees
Labels
No labels