var pdate = function(timestamp){ timestamp = parseInt(timestamp, 10) if (timestamp < 1000000000000){ timestamp = timestamp * 1000; } return new Date(timestamp).toLocaleString().replace(',', ''); } var pdate_short = function (timestamp) { var z = pdate(timestamp); return z.split('/')[0] + '/' + z.split('/')[1] + ' ' + z.split(' ')[1].split(':')[0] + ':' + z.split(' ')[1].split(':')[1] + ' ' + z.split(' ')[2]; } var ptime = function(timestamp){ timestamp = parseInt(timestamp, 10) if (timestamp < 1000000000000){ timestamp = timestamp * 1000; } var d = new Date(timestamp); h = d.getHours(); m = d.getMinutes(); s = d.getSeconds(); if (h < 10){ h = "0" + h; } if (m < 10){ m = "0" + m; } if (s < 10){ s = "0" + s; } return h + ":" + m + ":" + s } function toFixed(n, fixed) { return ~~(Math.pow(10, fixed) * n) / Math.pow(10, fixed); } function niceDuration(seconds) { var result = '' remaining = seconds; if (remaining >= 3600){ result += toFixed(remaining / 3600, 0) + 'h'; } remaining = remaining % 3600; if (remaining >= 60) { result += toFixed(remaining / 60, 0) + 'm'; } remaining = remaining % 60; if (remaining > 0) { result += toFixed(remaining, 0) + 's'; } return result; } function niceDurationFractional(seconds) { if (seconds >= 3600) { return '' + toFixed(seconds / 3600 , 1) + 'h'; } if (seconds >= 60) { return '' + toFixed(seconds / 60 , 1) + 'm'; } else { return '' + seconds + 's'; } } function horizBarChart(canvas, values, maxVal, bgColor='#010101', colors=["#14cc70", 'blue', 'red'], border=true, borderColor='#14cc70') { var ctx = canvas.getContext("2d"); ctx.fillStyle = bgColor; ctx.fillRect(0, 0, canvas.width, canvas.height); barHeight = canvas.height / values.length; for (var i=0; i?' } else { return '🙍‍♂️' } } function nbspByCount(count) { let result = ''; for (let i=0; i