Created
April 20, 2017 13:52
-
-
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
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
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