The Benefits of Auto Loan Pre-Approval
$(document).ready(function() {
$('#lhnContainerDone').hide(); //hides the link by default
var d = new Date(); //gets the current date time
var n = d.getDay(); //determines day of the week ... 0=Sun, 1=Mon...
if (n >= 1 && n <= 4)
{ //checks if it is Monday through thursday
var startt = new Date(); //creates a start date
startt.setHours(09); //sets start date hour to 9
startt.setMinutes(0); // sets start minutes to 00
var endt = new Date(); //creates end date
endt.setHours(17); //sets end date time to 5 PM
endt.setMinutes(30); //sets end date minutes to 5:30 PM
if (d >= startt && d <= endt) //checks to see if the current date/time is between the start and end date
$('#lhnContainerDone').show(); //shows the link if it is true
}
else if (n == 5) // day is friday
{
var startt = new Date(); //creates a start date
startt.setHours(09); //sets start date hour to 9
startt.setMinutes(0); // sets start minutes to 00
var endt = new Date(); //creates end date
endt.setHours(18); //sets end date time to 6 PM
endt.setMinutes(00); //sets end date minutes 00
if (d >= startt && d <= end) //checks to see if the current date/time is between the start and end date
$('#lhnContainerDone').show(); //shows the link if it is true
}
else
{
$('#lhnContainerDone').hide(); //hides the link if false
}
});