OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 |
| 6 /** |
| 7 * @fileoverview A placeholder for google closure library functions |
| 8 */ |
| 9 |
| 10 var goog = {}; |
| 11 goog.object = {}; |
| 12 goog.object.forEach = function (obj, f, optObj) { |
| 13 "use strict"; |
| 14 var key; |
| 15 for (key in obj) { |
| 16 if (obj.hasOwnProperty(key)) { |
| 17 f.call(optObj, obj[key], key, obj); |
| 18 } |
| 19 } |
| 20 }; |
| 21 |
| 22 goog.time = {}; |
| 23 goog.time.millisToString = function (timeMillis) { |
| 24 "use strict"; |
| 25 function pad(num) { |
| 26 num = num.toString(); |
| 27 if (num.length < 2) { |
| 28 return "0" + num; |
| 29 } |
| 30 return num; |
| 31 } |
| 32 |
| 33 var date = new Date(timeMillis); |
| 34 return pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + |
| 35 pad(date.getUTCSeconds()) + ' ' + pad((date.getMilliseconds()) % 1000); |
| 36 }; |
OLD | NEW |