Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Created February 20, 2017 15:21
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 andrasguseo/77073707356b4e9bc55e23bb7ebd67bc to your computer and use it in GitHub Desktop.
Save andrasguseo/77073707356b4e9bc55e23bb7ebd67bc to your computer and use it in GitHub Desktop.
Temporary fix for the Community Events timepicker format
<?php
/*
* Changes the formatting of the timepicker in The Events Calendar: Community Events submission form
* Change format in line 17 based on https://codex.wordpress.org/Formatting_Date_and_Time
*
* Author: Barry Hughes
*/
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