| Index: src/date-delay.js
|
| diff --git a/src/date-delay.js b/src/date-delay.js
|
| index 2421e5baecc94c2602e9d6fafd4e500da2de0d1b..dbb9c2c044d4f0e20efb205c5a75619dbd724d7c 100644
|
| --- a/src/date-delay.js
|
| +++ b/src/date-delay.js
|
| @@ -985,6 +985,25 @@ function DateToGMTString() {
|
| }
|
|
|
|
|
| +function PadInt(n) {
|
| + // Format integers to have at least two digits.
|
| + return n < 10 ? '0' + n : n;
|
| +}
|
| +
|
| +
|
| +function DateToISOString() {
|
| + return this.getUTCFullYear() + '-' + PadInt(this.getUTCMonth() + 1) +
|
| + '-' + PadInt(this.getUTCDate()) + 'T' + PadInt(this.getUTCHours()) +
|
| + ':' + PadInt(this.getUTCMinutes()) + ':' + PadInt(this.getUTCSeconds()) +
|
| + 'Z';
|
| +}
|
| +
|
| +
|
| +function DateToJSON(key) {
|
| + return CheckJSONPrimitive(this.toISOString());
|
| +}
|
| +
|
| +
|
| // -------------------------------------------------------------------
|
|
|
| function SetupDate() {
|
| @@ -1044,7 +1063,9 @@ function SetupDate() {
|
| "toGMTString", DateToGMTString,
|
| "toUTCString", DateToUTCString,
|
| "getYear", DateGetYear,
|
| - "setYear", DateSetYear
|
| + "setYear", DateSetYear,
|
| + "toISOString", DateToISOString,
|
| + "toJSON", DateToJSON
|
| ));
|
| }
|
|
|
|
|