Question: I am not a javascript coder, but I need to modify this code so that I can have a status bar shown for multiple times during the week. How can I add to this statement to cover another day of the week or other times on Sunday? I need to have the bar show up Sunday from 5pm to 7pm and Thursday between 7p and 9p. Just wondered how I could modify this to work. Can someone help? 

```
var d = new Date();
var Day = d.getDay();
var Time = d.getHours();
    if (d.getDay() == 0 && d.getHours() >= 9 && d.getHours() <= 12) {
      jQuery(".streaming").show();
    } else {
      jQuery(".streaming").hide();
    }

```

Answer: 
First of all, you must understand how the Date's instance methods that you are using works. You can try it here [getDay](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay), and here [getHours](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours). 

So, you code goes to something like:

```
var date = new Date();
var day = date.getDay();
var hour = date.getHours();

if ((day == 0 && hour >= 17 && hour <= 19) ||
    (day == 5 && hour >= 19 && hour <= 21)) {
    jQuery(".streaming").show();
} else {
    jQuery(".streaming").hide();
}

```

You should take a look at the [OR](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators#Logical_OR) (||) operator in JavaScript too.
I would suggest you to refactor like this

```
if (showForDay(d)) {
  jQuery(".streaming").show();
} else {
  jQuery(".streaming").hide();
}

function showForDay(d){
  // put all your conditions here
  if (d.getDay() == 0 && d.getHours() >= 9 && d.getHours() <= 12) return true
  if (d.getDay() == 0 && d.getHours() >= 12 && d.getHours() <= 14) return true
  ...
  return false // will be hidden
}

```