Gravity Perks // GP Conditional Logic Dates // Adjust User's Local Time to UTC
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 | |
/** | |
* Gravity Perks // GP Conditional Logic Dates // Adjust User's Local Time to UTC | |
* http://gravitywiz.com/documentation/gravity-forms-conditional-logic-dates/ | |
*/ | |
// Update "123" to the ID of your form - or - remove to apply to all forms. | |
add_action( 'gform_pre_render_123', function( $form ) { | |
add_action( 'wp_footer', 'gpcld_enable_utc_timezone_script' ); | |
add_action( 'gform_preview_footer', 'gpcld_enable_utc_timezone_script' ); | |
function gpcld_enable_utc_timezone_script() { | |
?> | |
<script> | |
gform.addFilter( 'gpcld_enable_utc_timezone', function( enable ) { | |
return true; | |
} ); | |
</script> | |
<?php | |
} | |
return $form; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/gravitywiz/snippet-library/blob/master/gp-conditional-logic-dates/gpcld-enable-utc-timezone.js