jQuery(document).ready(function($){ $(document).ready(function () { var start = new Date(); var end = new Date(); var time = new Date().getTime(); var weekday = new Date().getDay(); var newtime = new Date().getHours() console.log(weekday); console.log(newtime); $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); //monday if (weekday = (1) ) { if (newtime > (2) ) { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').show(); } else { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').show(); $('.monday').hide(); } } //tuesday if (weekday = (2) ) { if (newtime > (2) ) { $('.tuesday').show(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } else { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').show(); } } //wednesday else if (weekday = (3) ) { if (newtime > (2) ) { $('.tuesday').hide(); $('.wednesday').show(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } else { $('.tuesday').show(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } } //thursday else if (weekday = (4) ) { if (newtime > (2) ) { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').show(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } else { $('.tuesday').hide(); $('.wednesday').show(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } } //friday else if (weekday = (5) ) { if (newtime > (2) ) { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').show(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } else { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').show(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } } //saturday else if (weekday = (6) ) { if (newtime > (2) ) { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').show(); $('.sunday').hide(); $('.monday').hide(); } else { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').show(); $('.saturday').hide(); $('.sunday').hide(); $('.monday').hide(); } } //sunday else if (weekday = (7) ) { if (newtime > (2) ) { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').hide(); $('.sunday').show(); $('.monday').hide(); } else { $('.tuesday').hide(); $('.wednesday').hide(); $('.thursday').hide(); $('.friday').hide(); $('.saturday').show(); $('.sunday').hide(); $('.monday').hide(); } } }); });