How to check if current time falls within a specific range on a week day using jquery/javascript? -



How to check if current time falls within a specific range on a week day using jquery/javascript? -

when user visits page need check if current time falls between 9:00 , 5:30pm on weekday , display using jquery/javascript.but not sure how can check that.

could please help?

thanks

this should help:

function checktime() { var d = new date(); // current time var hours = d.gethours(), var mins = d.getminutes(); var day = d.getday(); homecoming day >= 1 && day <= 5 && hours >= 9 && (hours < 17 || hours === 17 && mins <= 30); }

javascript jquery datetime weekday

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

content management system - How to allow only English submissions on Pligg CMS -

c++ - Is it possible to apply breadth-first search algorithm of boost library to matrix? -