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) { function secondsToString(seconds) {
var numyears = Math.floor(seconds / 31536000); var a = new Date(seconds * 1000);
var numdays = Math.floor((seconds % 31536000) / 86400); var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600); var year = a.getFullYear();
var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60); var month = months[a.getMonth()];
var numseconds = (((seconds % 31536000) % 86400) % 3600) % 60; var date = a.getDate();
if ( numyears != 0 ) { var hour = a.getHours();
return numyears + ' yrs ago' var min = a.getMinutes();
} else if ( numdays != 0 ) { var sec = a.getSeconds();
return numdays + ' dys ago' var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
} else if ( numhours != 0 ) { return time;
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";
} }

Loading…
Cancel
Save