Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Last active February 13, 2016 00:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/e7a461c24fe75f6decaa to your computer and use it in GitHub Desktop.
Save joshfeck/e7a461c24fe75f6decaa to your computer and use it in GitHub Desktop.
Change the Event Espresso 4 datepicker format so dates are formatted like 31/01/2016 (dd/mm/yyyy)
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function jf_change_ee_reg_form_datepicker_format() {
?>
<script>
jQuery(document).ready(function($) {
$('.datepicker').datepicker({
changeYear: true,
yearRange: "1960:2010", // for more info see http://api.jqueryui.com/datepicker/#option-yearRange
dateFormat: 'dd/mm/yy'
});
});
</script>
<?php
}
add_action( 'AHEE__SPCO__reg_form_footer', 'jf_change_ee_reg_form_datepicker_format', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment