This is somewhat of a bug/feature request depending on how you look at it. The long and the short of it is I’ve added a date field to the booking form to capture the users birthdate, unfortunately the date picker is locked to a 20 year span around today which doesn’t make much sense for a birthdate field and it does not appear to be configurable in any way.
Thanks
Kyle Klaus
Hi Kyle,
Its possible to configure the behaviour of the datepicker – but there’s no UI for doing so. You’ll have to make the changes using code in a custom plugin / theme’s functions.php.
More details can be found on this page: http://wp-event-organiser.com/blog/announcements/event-organiser-pro-1-11-0-rc1/ but here’s an example:
add_action( 'eventorganiser_get_event_booking_form', 'my_set_datepicker_settings', 10, 2 );
function my_set_datepicker_settings( $form, $event_id ) {
//Get the datepicker to edit
$datepicker = $form->get_element( 7 ); //change to ID of datepicker
if ( ! $datepicker ) {
return;
}
//Get the data attribute (this will be an array)
$data = $datepicker->get( 'data' );
//Set the data attributes as required
$data['dp_min-date'] = '+0d'; //Only allow dates after today
$data['dp_max-date'] = '+20y'; //... and before 20 years time
$data['dp_year-range'] = 'c-0:c+15'; //Restrict the year dropdown to +15 years
$data['dp_append-text'] = '(dd-mm-yyyy)'; //Append text to the field
$data['dp_show-week'] = true; //show week numbers
//Update the datepicker with the new data attributes
$datepicker->set( 'data', $data );
}
Stephen Harris