title: JavaScript: override Date.prototype.constructor
body: <p>I'd like to change the behaviour of the standard Date object. Years between <code>0..99</code> passed to the constructor should be interpreted as <code>fullYear</code> (no add of <code>1900</code>). But my following function doesn't work</p>
  
  <pre><code>var oDateConst = Date.prototype.constructor; // save old contructor
  
  Date.prototype.constructor = function () {
      var d = oDateConst.apply(oDateConst, arguments); // create object with it
      if ( ((arguments.length == 3) || (arguments.length == 6))
          &amp;&amp; ((arguments[0] &lt; 100) &amp;&amp; (arguments[0] &gt;= 0))) {
          d.setFullYear(arguments[0]);
      }
      return d;
  }
  </code></pre>
  
  <p>Why does it never get called? How would you solve this problem?</p>