title: Date format YYYY-MM-DD not working in Safari
body: <p>I have this problem with Safari not recognizing the date format 2012-01-03 (being 2012 January 3rd). I have the dates within an array and then I want to convert them to this format - <strong>Tuesday Jan 3</strong></p>
  
  <p>Works in Chrome, but Safari is throwing <strong>undefined undefined NaN</strong>.</p>
  
  <p>Some code below...</p>
  
  <pre><code>(function() {
      var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
          months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
      Date.prototype.getDayName = function() {
          return days[this.getDay()];
      };
      Date.prototype.getMonthName = function() {
          return months[this.getMonth()];
      };
  })();
  
  var issues = ['2012-01-03', '2012-01-02', '2012-01-01', '2011-12-31'];
  
  for (var i = 0; i &lt; issues.length; i++) {
        var d = new Date(issues[i]);
        var date = d.getDate(),
        weekday = d.getDayName(),
        month = d.getMonthName();
        day = weekday + ' ' + month + ' ' + date;               
        $('.datepicker').find('ul').append('&lt;li class="issue_' + i + '"&gt;' + day + '&lt;/li&gt;');
  }   
  </code></pre>
  
  <p>I only need this to work for Safari/Mobile Safari, so prefer not to use any js library.</p>