title: Uncaught ReferenceError: text is not defined with date
body: <p>Good morning everybody!</p>
  
  <p>I have a problem with javascript. I'm using cases with different days per month. Until December I don't have issues, but when January start (today, firs day of the school) the code doesn't show my schedule and the console display this errors:</p>
  
  <p><strong>Uncaught ReferenceError: text is not defined
      at cambiar_imagen (English1.html:386)
      at onload (English1.html:396)</strong></p>
  
  <p>I was thinking that maybe is the date format, beause of this I have an alert with my variable "dia", this variable content the current date.</p>
  
  <p>This is my code:</p>
  
  <p>
      Tablet</p>
  
  <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  function cambiar_imagen (){
          var hoy = new Date();
          var hora = hoy.toLocaleTimeString();
          var day = hoy.getDate();
          var month = hoy.getMonth()+1;
          var year = hoy.getFullYear();
          var dia = (day + "/" + month + "/" + year);
          switch(dia) {
              //A DAY
  
                  //october
                  case "18/10/2017":  case "20/10/2017":  case "24/10/2017":  case "26/10/2017":
  
                  //november
                  case "6/11/2017":   case "8/11/2017":   case "10/11/2017":  case "14/11/2017":  case "16/11/2017":  case "20/11/2017":  case "22/11/2017":
                  case "24/11/2017":  case "28/11/2017":  case "30/11/2017":
  
                  //december
                  case "4/12/2017":   case "7/12/2017":   case "12/12/2017":  case "14/12/2017":  case "18/12/2017":  case "20/12/2017":
  
                  //january
                  case "8/1/2017":    case "10/1/2017":   case "12/1/2017":   case "16/1/2017":   case "19/1/2017":   case "23/1/2017":   case "25/1/2017":
                  case "29/1/2017":   case "31/1/2017":
  
                  //february
                  case "2/2/2017":    case "6/2/2017":    case "8/2/2017":    case "19/2/2017":   case "21/2/2017":   case "23/2/2017":   case "27/2/2017":
  
                  //march
                  case "2/3/2017":    case "6/3/2017":    case "8/3/2017":    case "12/3/2017":   case "14/3/2017":   case "16/3/2017":   case "20/3/2017":
                  case "22/3/2017":
  
                  //april
                  case "3/4/2017":    case "5/4/2017":    case "9/4/2017":    case "11/4/2017":   case "13/4/2017":   case "17/4/2017":   case "19/4/2017":
                  case "23/4/2017":   case "25/4/2017":   case "27/4/2017":
  
                  //may
                  case "2/5/2017":    case "4/5/2017":    case "8/5/2017":    case "10/5/2017":   case "14/5/2017":   case "16/5/2017":   case "18/5/2017":
                  case "22/5/2017":   case "24/5/2017":   case "28/5/2017":   case "30/5/2017":
  
                  //june
                  case "1/6/2017":    case "5/6/2017":    case "7/6/2017":    case "11/6/2017":   case "13/6/2017":   case "15/6/2017":   case "19/6/2017":
  
                  var hoy = new Date();
                  var hora = hoy.toLocaleTimeString();
                  var pr = [
                      ['Period 1 (08:30 - 09:45): Ms. Liz Edwards - Social Studies Psychology 11'],
                      ['Period 2 (10:00 - 11:15): Ms. Liz Edwards - English 9A'],
                      ['Period 3 (12:45 - 14:00): Mr. Joe Brogan - Social Studies 11 World History'],
                      ['Period 4 (14:15 - 15:30): Ms. Liz Edwards - English 11 Language &amp; Literature'],
                      ['Enrichment (15:30 - 16:00): Mr. Toni Bauça - Homework Club 7+8'],
                      ['Homeroom PM (16:45 - 17:30): David Pringuer - Homeroom 10 (T)']
                              ];
  
                      //First Period
                      if
                          (hora &gt; "8:30:00 AM" &amp;&amp; hora &lt;= "9:45:00 AM") {
  
                              text = "First Period - A Day";
                              text2 = "08:30 - 09:45";
                              text3 = "Social Studies Psychology 11";
                              text4 = "Ms. Liz Edwards";
                              text5 = "Next Periods"+"&lt;br&gt;"+"&lt;br&gt;";
                              pr = (pr[1][0])+"&lt;br&gt;"+"&lt;br&gt;"+(pr[2][0])+"&lt;br&gt;"+"&lt;br&gt;"+(pr[3][0]);
                              }
  </code></pre>
  
  <p>Can anybody help? Thanks!</p>