From 46f087fe486e0a2b7eb95880fed962ea64033515 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 9 Jan 2015 11:57:15 -0800 Subject: [PATCH] Fixed missing @da padding --- main/lib/urb.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main/lib/urb.js b/main/lib/urb.js index 46db0d45c..7fbb4c7f0 100644 --- a/main/lib/urb.js +++ b/main/lib/urb.js @@ -91,12 +91,15 @@ window.urb.unsubscribe = function(params,cb) { window.urb.util = { toDate: function (dat){ var mils = Math.floor((0x10000 * dat.getUTCMilliseconds()) / 1000).toString(16) + function pad(num, str){ + return ((new Array(num + 1)).join('0') + str).substr(-num,num) + } return '~' + dat.getUTCFullYear() + '.' + (dat.getUTCMonth() + 1) + '.' + dat.getUTCDate() + - '..' + dat.getUTCHours() + - '.' + dat.getUTCMinutes() + - '.' + dat.getUTCSeconds() + - '..' + ('0000' + mils).substr(-4, 4) + '..' + pad(2, dat.getUTCHours()) + + '.' + pad(2, dat.getUTCMinutes()) + + '.' + pad(2, dat.getUTCSeconds()) + + '..' + pad(4, mils) } }