title: How can I change default date format of Javascript?
body: <p>I have this code to change the date on the itinerary but it appears like this: <strong>Sat Apr 15 2017 00:00:00 GMT-0500 (CDT)</strong> I don't need the "time" and the next info (00:00:00 GMT-0500 (CDT)), I want the date display like this: <strong>Saturday, April 15 2017</strong></p>
  
  <p>Here is my code:</p>
  
  <pre><code>$.datepicker.regional['es'] = {
      closeText: 'Cerrar',
      prevText: '&lt; Ant',
      nextText: 'Sig &gt;',
      currentText: 'Hoy',
      monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
      monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
      dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
      dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Juv', 'Vie', 'Sáb'],
      dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'],
      weekHeader: 'Sm',
      dateFormat: 'dd/mm/yy',
      firstDay: 1,
      isRTL: false,
      showMonthAfterYear: false,
      yearSuffix: ''
  };
  $.datepicker.setDefaults($.datepicker.regional['es']);
  
  $(function() {
      $("#fecha").datepicker();
  });
  
  $(function() {
  
          var fechasdisponibles = ["4-1-2017", "4-8-2017", "4-15-2017", "4-22-2017", "4-29-2017", "5-6-2017", "5-13-2017", "5-20-2017", "5-27-2017", "6-3-2017", "6-10-2017", "6-17-2017", "6-24-2017",
              "7-1-2017", "7-8-2017", "7-15-2017", "7-22-2017", "7-29-2017", "8-5-2017", "8-12-2017", "8-19-2017", "8-26-2017", "9-2-2017", "9-9-2017", "9-16-2017", "9-23-2017",
              "9-30-2017", "10-7-2017", "10-14-2017", "10-21-2017", "10-28-2017", "11-4-2017", "11-18-2017", "12-2-2017", "12-9-2017", "12-16-2017", "12-23-2017", "12-30-2017",
              "1-6-2018", "1-20-2018", "2-3-2018", "2-17-2018", "3-3-2018", "3-17-2018", "3-31-2018"
          ];
  
          function habilitardias(date) {
              var sdate = $.datepicker.formatDate('m-d-yy', date)
              console.log(sdate)
              if ($.inArray(sdate, fechasdisponibles) != -1) {
                  return [true];
              }
              return [false];
  
          }
  
          $("#calendario").datepicker({
              beforeShowDay: habilitardias,
              dateFormat: 'DD, d MM, yy',
              firstDay: 7,
              defaultDate: 4,
              onSelect: function() {
                  var dateText = $.datepicker.formatDate("dd-mm-yy", $(this).datepicker("getDate"));
                  var fechaselecc = dateText;
                  var diamesyear = fechaselecc.split("-");
                  alert("Ha selecionado la fecha de salida: " + diamesyear + " Itinerario actualizado");
                  var undiasmasuno = new Date(parseInt(
                          diamesyear[2], 10),
                      parseInt(diamesyear[1], 10) - 1,
                      parseInt(diamesyear[0], 10)
                  );
                  $('#date-start-output').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output2').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output3').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output4').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output5').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output6').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output7').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
                  $('#date-start-output8').html(undiasmasuno + " ");
                  undiasmasuno.setDate(undiasmasuno.getDate() + 1);
              },
          });
      }
  );
  
  &lt;/script&gt;
  
  &lt;body&gt;
      &lt;div type="text" id="calendario" name="calendario"&gt;&lt;/div&gt;
  
      &lt;strong&gt;&lt;span id="date-start-output" class="date start" style="color: #ff0000;"&gt;Día 1º: &lt;/span&gt;&lt;span style="color: #ff0000;"&gt;MÉXICO-MADRID (Sábado)&lt;/span&gt;&lt;/strong&gt;&lt;br&gt; Salida en vuelo internacional hacia Madrid.&lt;br&gt;
      &lt;strong&gt;&lt;span id="date-start-output2" class="imprimevari" style="color: #ff0000;"&gt;Día 2º: &lt;/span&gt;&lt;span style="color: #ff0000;"&gt;MÉXICO-MADRID)&lt;/span&gt;&lt;/strong&gt;&lt;br&gt; Salida en vuelo internacional hacia Madrid.&lt;br&gt;
      &lt;strong&gt;&lt;span id="date-start-output3" class="imprimevari" style="color: #ff0000;"&gt;Día 2º: &lt;/span&gt;&lt;span style="color: #ff0000;"&gt;MÉXICO-MADRID)&lt;/span&gt;&lt;/strong&gt;&lt;br&gt; Salida en vuelo internacional hacia Madrid.&lt;br&gt;
      &lt;strong&gt;&lt;span id="date-start-output4" class="imprimevari" style="color: #ff0000;"&gt;Día 2º: &lt;/span&gt;&lt;span style="color: #ff0000;"&gt;MÉXICO-MADRID)&lt;/span&gt;&lt;/strong&gt;&lt;br&gt; Salida en vuelo internacional hacia Madrid.&lt;br&gt;
  &lt;/body&gt;
  </code></pre>