Created
March 21, 2017 16:11
-
-
Save RobertCalise/24715acfc82b1943fa27ae513c4bf654 to your computer and use it in GitHub Desktop.
Fill Infusionsoft Timezone Field
This file contains hidden or 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
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.6/jstz.js"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
var tz = jstz.determine().name(), | |
selected = jQuery('#Contact0TimeZone option[value="' + tz + '"]').prop('selected', true).val(); | |
if(selected === undefined) { | |
/* If no match found, default to America/New_York as a fallback */ | |
jQuery('#Contact0TimeZone option[value="America/New_York"]').prop('selected', true); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment