title: How to use JSON.parse reviver parameter to parse date string
body: <p>My JSON string contains a date field that returns such a value:</p>
  
  <pre><code>"2009-04-04T22:55:16.0000000-04:00"
  </code></pre>
  
  <p>I am particularly interested in parsing only the date compartment not the time. I tried using a reviver function, but interestingly the reviver function is never invoked! (tried on Firefox)</p>
  
  <p>Here is my code to accomplish that:</p>
  
  <pre><code>var Site = {
  .....
  dateReviver: function(key, value) {
      var a;
      if (typeof value === 'string') {
          a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
          if (a) {
              return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                              +a[5], +a[6]));
          }
      }
      return value;
  },
  loadArticle: function(id) {
  ....
      proxy.getArticle(id, function(response) {
          var data = JSON.parse(response.result, Site.dateReviver);
          ....
      });
  }
  };
  </code></pre>
  
  <p>JSON.parse in <code>loadArticle</code> never calls <code>dateReviver</code>.</p>
  
  <p>I invested a whole day but no luck! Could someone please help me? </p>