# HG changeset patch # User Emmanuel Gil Peyrot # Date 1289930415 -3600 # Node ID 5395a501c99106395f07741a706b43e07c57e954 # Parent 45d0cd9388ea7d1cb08996ce8a2cab2ebfab7a10 Use internal toISOString method of Data. diff -r 45d0cd9388ea -r 5395a501c991 iso8601.js --- a/iso8601.js Wed Nov 10 18:31:02 2010 +0100 +++ b/iso8601.js Tue Nov 16 19:00:15 2010 +0100 @@ -34,14 +34,5 @@ }; 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'); };