I have this code that I only want to appear on a certain date. Which this code works just fine in Firefox, Chrome, and even safari. The code however is not working on IE. And I have no clue why.
I found that .toLocaleString() in IE separated them with a space instead of a comma.
function givingTuesdayCode(){
var isIE = /*@cc_on!@*/false || !!document.documentMode;
var now = calcTime(-6);
var splitnow = "";
if ( isIE ){ splitnow = now.split(" "); }
else{ splitnow = now.split(","); }
if (splitnow[0] == "12/2/2014"){
$('.introrotation').html("<img style='width:100%; height:auto' class='givingTuesday' src='/graphics/PoliticGov_620x265.jpg' alt='Give to us'/> <a href='http://IllinoisState.edu/GivingTuesday' class='GiveButtonLink'>Giving Tuesday: Join us!</a> <p style='color:black; position:relative; top:-85px; margin:10px'>Black Friday and Cyber Monday have come and gone. Today, join your fellow Redbirds and make a gift that matters. Give today at <a href='http://IllinoisState.edu/GivingTuesday' class='GiveLink'>IllinoisState.edu/GivingTuesday</a></p>");
$('.introrotation').css({'height': '265px'
});
$('.toggleButton').css({'display': 'none'
});
}
function calcTime(offset){
var date = new Date();
var utc = date.getTime()+(360*60000);
var nd = new Date(utc+(3600000*offset));
return nd.toLocaleString();
}