var week_object = { day1: { text: ['7:00 AM Eastern', '10:00 AM Eastern', '1:00 PM Eastern', '7:00 PM Eastern'], value: ['[i4w_date date="{:day1value:}" operation="+7 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day1value:}" operation="+10 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day1value:}" operation="+13 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day1value:}" operation="+19 hours" format="Y-m-d H:i:s"]'] }, day2: { text: ['8:00 AM Eastern', '11:00 AM Eastern', '2:00 PM Eastern', '8:00 PM Eastern'], value: ['[i4w_date date="{:day2value:}" operation="+8 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day2value:}" operation="+11 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day2value:}" operation="+14 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day2value:}" operation="+20 hours" format="Y-m-d H:i:s"]'] }, day3: { text: ['10:00 AM Eastern', '1:00 PM Eastern', '5:00 PM Eastern', '9:00 PM Eastern'], value: ['[i4w_date date="{:day3value:}" operation="+10 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day3value:}" operation="+13 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day3value:}" operation="+17 hours" format="Y-m-d H:i:s"]', '[i4w_date date="{:day3value:}" operation="+21 hours" format="Y-m-d H:i:s"]'] } };
function default_setter(){
$('#slot_select').empty(); var selected_day = $('#day_select').val(); var selected_day_text_array = week_object[selected_day].text; var selected_day_value_array = week_object[selected_day].value; for(var i =0; i < selected_day_text_array.length ; i++) { $('#slot_select').append($("").attr("value",selected_day_value_array[i]).text(selected_day_text_array[i]));
}
}
function set_hidden(){
var day_value_text = $( "#day_select option:selected" ).text(); var time_value_text = $( "#slot_select option:selected" ).text(); var time_value_text_array = time_value_text.split(" ");
var time_value_value_array = $( "#slot_select" ).val().split(" "); var dashed_date_array = time_value_value_array[0].split("-"); var slashed_date = dashed_date_array[1]+"/"+dashed_date_array[2]+"/"+dashed_date_array[0]; var mdywithdash = dashed_date_array[1]+"-"+dashed_date_array[2]+"-"+dashed_date_array[0];
var time_value_value_time_array = time_value_value_array[1].split(":"); var hoursmins = time_value_value_time_array[0]+time_value_value_time_array[1]
var inf_custom_SSWebinarDateTime = day_value_text+" at "+time_value_text_array[0]+" "+time_value_text_array[1]; var inf_custom_TACWJWebicode = slashed_date+" "+hoursmins; var inf_custom_SSWebinarDateICS = slashed_date; var inf_custom_SSWebinarTimeICS = time_value_value_time_array[0]; var inf_custom_SSWebinarDate = mdywithdash; var inf_custom_i4wsmsdatetime = time_value_text_array[0]+" "+time_value_text_array[1];
$('#inf_custom_SSWebinarDateTime').val(inf_custom_SSWebinarDateTime); $('#inf_custom_TACWJWebicode').val(inf_custom_TACWJWebicode); $('#inf_custom_SSWebinarDateICS').val(inf_custom_SSWebinarDateICS); $('#inf_custom_SSWebinarTimeICS').val(inf_custom_SSWebinarTimeICS); $('#inf_custom_SSWebinarDate').val(inf_custom_SSWebinarDate); $('#inf_custom_i4wsmsdatetime').val(inf_custom_i4wsmsdatetime);
}
$(document).ready(function() {
default_setter();
set_hidden();
$('#day_select').change(function(){ $('#slot_select').empty(); var selected_day = $('#day_select').val(); var selected_day_text_array = week_object[selected_day].text; var selected_day_value_array = week_object[selected_day].value; for(var i =0; i < selected_day_text_array.length ; i++) { $('#slot_select').append($("").attr("value",selected_day_value_array[i]).text(selected_day_text_array[i]));
}
set_hidden();
}); $('#slot_select').change(function(){
set_hidden();
});
});
