Browse Source

history timestamp updated to unixtimestamp

master
Satinder Grewal 9 years ago
parent
commit
53d190181e
  1. 29
      assets/scripts/dashboard.js

29
assets/scripts/dashboard.js

@ -574,25 +574,16 @@ function StopTotalFiatValue() {
}
function secondsToString(seconds) {
var numyears = Math.floor(seconds / 31536000);
var numdays = Math.floor((seconds % 31536000) / 86400);
var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60;
if ( numyears != 0 ) {
return numyears + ' yrs ago'
} else if ( numdays != 0 ) {
return numdays + ' dys ago'
} else if ( numhours != 0 ) {
return numhours + ' hrs ago'
} else if ( numminutes != 0 ) {
return numminutes + ' mins ago'
} else if ( numseconds > 10 && numseconds <= 60 ) {
return numseconds + ' sec ago';
} else if ( numseconds <= 10 ) {
return 'Just Now'
}
//return numyears + " years " + numdays + " days " + numhours + " hours " + numminutes + " minutes " + numseconds + " seconds";
var a = new Date(seconds * 1000);
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
var sec = a.getSeconds();
var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
return time;
}

Loading…
Cancel
Save