Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
Created April 20, 2017 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoffgraham/1876be2c558518b17f7339c0b829ef79 to your computer and use it in GitHub Desktop.
Save geoffgraham/1876be2c558518b17f7339c0b829ef79 to your computer and use it in GitHub Desktop.
Community Events 4.4.4 // Force timepicker to use 24-hour time format
function ce_timepicker_24hr_fix() {
echo "
<script type='text/javascript'>
document.addEventListener( 'DOMContentLoaded', function() {
if ( 'function' !== typeof jQuery ) {
return;
}
setTimeout( function() {
jQuery( '.tribe-timepicker' ).timepicker( { 'timeFormat': 'H:i' } );
}, 500 );
}, false );
</script>
";
}
add_action( 'tribe_events_community_form_after_template', 'ce_timepicker_24hr_fix' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment