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
Post a Comment