Created
February 20, 2017 15:21
-
-
Save andrasguseo/77073707356b4e9bc55e23bb7ebd67bc to your computer and use it in GitHub Desktop.
Temporary fix for the Community Events timepicker 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
<?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