# HG changeset patch # User Emmanuel Gil Peyrot # Date 1289930415 -3600 # Node ID 5395a501c99106395f07741a706b43e07c57e954 # Parent 45d0cd9388ea7d1cb08996ce8a2cab2ebfab7a10 Use internal toISOString method of Data. diff --git a/iso8601.js b/iso8601.js --- a/iso8601.js +++ b/iso8601.js @@ -34,14 +34,5 @@ Date.prototype.setFromISO8601 = function }; Date.prototype.toString = function () { - var pad = function (n) { - return ((n < 10)? '0': '') + n; - }; - - return this.getUTCFullYear() + - "-" + pad(this.getUTCMonth() + 1) + - "-" + pad(this.getUTCDate()) + - "T" + pad(this.getUTCHours()) + - ":" + pad(this.getUTCMinutes()) + - ":" + pad(this.getUTCSeconds()) + 'Z'; + return this.toISOString().replace(/\....Z$/, 'Z'); };