OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/base.html"> | 8 <link rel="import" href="/tracing/base/base.html"> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return cur[part]; | 109 return cur[part]; |
110 } else if (part in cur) { | 110 } else if (part in cur) { |
111 cur = cur[part]; | 111 cur = cur[part]; |
112 } else { | 112 } else { |
113 return undefined; | 113 return undefined; |
114 } | 114 } |
115 } | 115 } |
116 return undefined; | 116 return undefined; |
117 } | 117 } |
118 | 118 |
| 119 /** |
| 120 * Format date as a string "YYYY-MM-DD HH:mm:ss". The timezone is implicitly |
| 121 * UTC. This format is based on the ISO format, but without milliseconds and |
| 122 * the 'T' is replaced with a space for legibility. |
| 123 * |
| 124 * @param {!Date} date |
| 125 * @return {string} |
| 126 */ |
| 127 function formatDate(date) { |
| 128 return date.toISOString().replace('T', ' ').slice(0, 19); |
| 129 } |
| 130 |
119 return { | 131 return { |
120 addSingletonGetter: addSingletonGetter, | 132 addSingletonGetter: addSingletonGetter, |
121 | 133 |
122 deepCopy: deepCopy, | 134 deepCopy: deepCopy, |
123 | 135 |
124 normalizeException: normalizeException, | 136 normalizeException: normalizeException, |
125 stackTrace: stackTrace, | 137 stackTrace: stackTrace, |
126 stackTraceAsString: stackTraceAsString, | 138 stackTraceAsString: stackTraceAsString, |
| 139 formatDate: formatDate, |
127 | 140 |
128 getUsingPath: getUsingPath | 141 getUsingPath: getUsingPath |
129 }; | 142 }; |
130 }); | 143 }); |
131 </script> | 144 </script> |
OLD | NEW |