Solved! Go to Solution.
UPDATE: It appears that Marketo did some kind of update that made my previous solution no longer work. Now in order to get the Javascript to work I had to change the syntax from the encoded values back to the normal text values - so as follows:
<script type="text/javascript">
window.onload = function() {
var tz = "10:00 AM - 10:45 AM PDT";
if ("{{lead.Time Zone}}" == "Pacific/Tongatapu") {
tz = "6:00 AM - 6:45 AM TOT";
} else if ("{{lead.Time Zone}}" == "US/Samoa") {
tz = "6:00 AM - 6:45 AM SST";
} else if ("{{lead.Time Zone}}" == "US/Hawaii") {
tz = "7:00 AM - 7:45 AM HAST";
} else if ("{{lead.Time Zone}}" == "US/Aleutian") {
tz = "8:00 AM - 8:45 AM HADT";
} else if ("{{lead.Time Zone}}" == "US/Alaska") {
tz = "9:00 AM - 9:45 AM AKDT";
} else if ("{{lead.Time Zone}}" == "US/Pacific") {
tz = "10:00 AM - 10:45 AM PDT";
} else if ("{{lead.Time Zone}}" == "US/Arizona") {
tz = "10:00 AM - 10:45 AM MST";
} else if ("{{lead.Time Zone}}" == "US/Central") {
tz = "12:00 PM - 12:45 PM CDT";
...
} else {
tz = "10:00 AM - 10:45 AM PDT";
}
document.getElementById("timeZone").innerHTML = tz;
}
</script>
window.onload = function () {
var userTimeZone = "[user:TimeZone]";
var tz = "10:00 AM - 10:45 AM PDT";
if (userTimeZone == "Pacific/Tongatapu") {
tz = "6:00 AM - 6:45 AM TOT";
} else if (userTimeZone == "US/Samoa") {
tz = "6:00 AM - 6:45 AM SST";
} else if (userTimeZone == "US/Hawaii") {
tz = "7:00 AM - 7:45 AM HAST";
} else if (userTimeZone == "US/Aleutian") {
tz = "8:00 AM - 8:45 AM HADT";
} else if (userTimeZone == "US/Alaska") {
tz = "9:00 AM - 9:45 AM AKDT";
} else if (userTimeZone == "US/Pacific") {
tz = "10:00 AM - 10:45 AM PDT";
} else if (userTimeZone == "US/Arizona") {
tz = "10:00 AM - 10:45 AM MST";
} else if (userTimeZone == "US/Central") {
tz = "12:00 PM - 12:45 PM CDT";
} else if (userTimeZone == "US/Mountain") {
tz = "11:00 AM - 11:45 AM MDT";
} else if (userTimeZone == "Canada/Saskatchewan") {
tz = "11:00 AM - 11:45 AM CST";
} else if (userTimeZone == "America/Guatemala") {
tz = "11:00 AM - 11:45 AM CST";
} else if (userTimeZone == "America/Bogota") {
tz = "12:00 PM - 12:45 PM COT";
} else if (userTimeZone == "America/Mexico_City") {
tz = "12:00 PM - 12:45 PM CDT";
} else if (userTimeZone == "America/Caracas") {
tz = "12:30 PM - 1:15 PM VET";
} else if (userTimeZone == "US/Eastern") {
tz = "1:00 PM - 1:45 PM EDT";
} else if (userTimeZone == "America/Santiago") {
tz = "1:00 PM - 1:45 PM CLT";
} else if (userTimeZone == "America/La_Paz") {
tz = "1:00 PM - 1:45 PM BOT";
} else if (userTimeZone == "Brazil/East") {
tz = "2:00 PM - 2:45 PM BRT";
} else if (userTimeZone == "America/Halifax") {
tz = "2:00 PM - 2:45 PM ADT";
} else if (userTimeZone == "America/Buenos_Aires") {
tz = "2:00 PM - 2:45 PM ART";
} else if (userTimeZone == "America/Montevideo") {
tz = "2:00 PM - 2:45 PM UYT";
} else if (userTimeZone == "America/St_Johns") {
tz = "2:30 PM - 3:15 PM NDT";
} else if (userTimeZone == "Atlantic/South_Georgia") {
tz = "3:00 PM - 3:45 PM GST";
} else if (userTimeZone == "America/Godthab") {
tz = "3:00 PM - 3:45 PM WGST";
} else if (userTimeZone == "Atlantic/Cape_Verde") {
tz = "4:00 PM - 4:45 PM CVT";
} else if (userTimeZone == "Greenwich") {
tz = "5:00 PM - 5:45 PM GMT";
} else if (userTimeZone == "Atlantic/Azores") {
tz = "5:00 PM - 5:45 PM AZOST";
} else if (userTimeZone == "Europe/Lisbon") {
tz = "6:00 PM - 6:45 PM WEST";
} else {
tz = "10:00 AM - 10:45 AM PDT - default result";
}
document.getElementById("timeZone").innerHTML = tz;
};
</script>
UPDATE: It appears that Marketo did some kind of update that made my previous solution no longer work. Now in order to get the Javascript to work I had to change the syntax from the encoded values back to the normal text values - so as follows:
<script type="text/javascript">
window.onload = function() {
var tz = "10:00 AM - 10:45 AM PDT";
if ("{{lead.Time Zone}}" == "Pacific/Tongatapu") {
tz = "6:00 AM - 6:45 AM TOT";
} else if ("{{lead.Time Zone}}" == "US/Samoa") {
tz = "6:00 AM - 6:45 AM SST";
} else if ("{{lead.Time Zone}}" == "US/Hawaii") {
tz = "7:00 AM - 7:45 AM HAST";
} else if ("{{lead.Time Zone}}" == "US/Aleutian") {
tz = "8:00 AM - 8:45 AM HADT";
} else if ("{{lead.Time Zone}}" == "US/Alaska") {
tz = "9:00 AM - 9:45 AM AKDT";
} else if ("{{lead.Time Zone}}" == "US/Pacific") {
tz = "10:00 AM - 10:45 AM PDT";
} else if ("{{lead.Time Zone}}" == "US/Arizona") {
tz = "10:00 AM - 10:45 AM MST";
} else if ("{{lead.Time Zone}}" == "US/Central") {
tz = "12:00 PM - 12:45 PM CDT";
...
} else {
tz = "10:00 AM - 10:45 AM PDT";
}
document.getElementById("timeZone").innerHTML = tz;
}
</script>