Created
May 3, 2017 03:50
-
-
Save trishasalas/290b9d15bd9a92b81c5e5a9da6f0e5cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 community_events_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', 'community_events_timepicker_24hr_fix' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment