Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created February 28, 2017 16:49
An example of how you can change the dateform used by the EE datepicker question type.
<?php //Please do not include the opening PHP tag if you already have one.
//A function to change the dateFormat used by the datepicker on the checkout page.
function tw_ee_datepicker_date_format() {
if( is_page( 'registration-checkout' ) ) {
wp_add_inline_script( 'jquery-ui-datepicker', "jQuery(document).ready(function(jQuery){jQuery('.ee-reg-qstn.datepicker').datepicker({ dateFormat: 'MM d, yy' })});" );
}
}
add_action( 'wp_enqueue_scripts', 'tw_ee_datepicker_date_format', 1200, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment