OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 return (x > 9 ? "" : "0") + x; | 363 return (x > 9 ? "" : "0") + x; |
364 } | 364 } |
365 return this.getFullYear() + | 365 return this.getFullYear() + |
366 leadZero(this.getMonth() + 1) + | 366 leadZero(this.getMonth() + 1) + |
367 leadZero(this.getDate()) + "T" + | 367 leadZero(this.getDate()) + "T" + |
368 leadZero(this.getHours()) + | 368 leadZero(this.getHours()) + |
369 leadZero(this.getMinutes()) + | 369 leadZero(this.getMinutes()) + |
370 leadZero(this.getSeconds()); | 370 leadZero(this.getSeconds()); |
371 } | 371 } |
372 | 372 |
| 373 /** |
| 374 * @return {string} |
| 375 */ |
| 376 Date.prototype.toConsoleTime = function() |
| 377 { |
| 378 /** |
| 379 * @param {number} x |
| 380 * @return {string} |
| 381 */ |
| 382 function leadZero2(x) |
| 383 { |
| 384 return (x > 9 ? "" : "0") + x; |
| 385 } |
| 386 |
| 387 /** |
| 388 * @param {number} x |
| 389 * @return {string} |
| 390 */ |
| 391 function leadZero3(x) |
| 392 { |
| 393 return (Array(4 - x.toString().length)).join('0') + x; |
| 394 } |
| 395 |
| 396 return this.getFullYear() + "-" + |
| 397 leadZero2(this.getMonth() + 1) + "-" + |
| 398 leadZero2(this.getDate()) + " " + |
| 399 leadZero2(this.getHours()) + ":" + |
| 400 leadZero2(this.getMinutes()) + ":" + |
| 401 leadZero2(this.getSeconds()) + "." + |
| 402 leadZero3(this.getMilliseconds()); |
| 403 } |
| 404 |
373 Object.defineProperty(Array.prototype, "remove", | 405 Object.defineProperty(Array.prototype, "remove", |
374 { | 406 { |
375 /** | 407 /** |
376 * @param {!T} value | 408 * @param {!T} value |
377 * @param {boolean=} onlyFirst | 409 * @param {boolean=} onlyFirst |
378 * @this {Array.<!T>} | 410 * @this {Array.<!T>} |
379 * @template T | 411 * @template T |
380 */ | 412 */ |
381 value: function(value, onlyFirst) | 413 value: function(value, onlyFirst) |
382 { | 414 { |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 this._outgoingCallback(); | 1560 this._outgoingCallback(); |
1529 } | 1561 } |
1530 } | 1562 } |
1531 | 1563 |
1532 /** | 1564 /** |
1533 * @param {*} value | 1565 * @param {*} value |
1534 */ | 1566 */ |
1535 function suppressUnused(value) | 1567 function suppressUnused(value) |
1536 { | 1568 { |
1537 } | 1569 } |
OLD | NEW |