mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
Fixed missing @da padding
This commit is contained in:
parent
39516d2f8c
commit
46f087fe48
@ -91,12 +91,15 @@ window.urb.unsubscribe = function(params,cb) {
|
|||||||
window.urb.util = {
|
window.urb.util = {
|
||||||
toDate: function (dat){
|
toDate: function (dat){
|
||||||
var mils = Math.floor((0x10000 * dat.getUTCMilliseconds()) / 1000).toString(16)
|
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() +
|
return '~' + dat.getUTCFullYear() +
|
||||||
'.' + (dat.getUTCMonth() + 1) +
|
'.' + (dat.getUTCMonth() + 1) +
|
||||||
'.' + dat.getUTCDate() +
|
'.' + dat.getUTCDate() +
|
||||||
'..' + dat.getUTCHours() +
|
'..' + pad(2, dat.getUTCHours()) +
|
||||||
'.' + dat.getUTCMinutes() +
|
'.' + pad(2, dat.getUTCMinutes()) +
|
||||||
'.' + dat.getUTCSeconds() +
|
'.' + pad(2, dat.getUTCSeconds()) +
|
||||||
'..' + ('0000' + mils).substr(-4, 4)
|
'..' + pad(4, mils)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user