title: Getting localized day of week
body: <p>I'd like to get the names of the days of the weeks in JavaScript, localized to the user's current language; preferably with something a bit nicer than what I'm using now:</p>
  
  <pre><code>var weekDays = [];
  var d = new Date();
  
  while(d.getDay() &gt; 0) {
      d.setDate(d.getDate() + 1);
  }
  
  while(weekDays.length &lt; 7) {
      weekDays.push(d.toLocaleDateString().match(/\w+/)[0]);
      d.setDate(d.getDate() + 1);
  }
  </code></pre>
  
  <p>Is there an easy way to do this? Or am I just going to have to provide date strings for as many locales as I can?</p>