Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: Source/devtools/front_end/utilities.js

Issue 185713007: DevTools: Add timestamp support in the console (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/inspector.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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=} firstOnly 409 * @param {boolean=} firstOnly
378 * @this {Array.<!T>} 410 * @this {Array.<!T>}
379 * @template T 411 * @template T
380 */ 412 */
381 value: function(value, firstOnly) 413 value: function(value, firstOnly)
382 { 414 {
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 this._outgoingCallback(); 1559 this._outgoingCallback();
1528 } 1560 }
1529 } 1561 }
1530 1562
1531 /** 1563 /**
1532 * @param {*} value 1564 * @param {*} value
1533 */ 1565 */
1534 function suppressUnused(value) 1566 function suppressUnused(value)
1535 { 1567 {
1536 } 1568 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/inspector.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698