1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

I'm literally a terrible person. Just LOOK at this commit. I did some stuff. A lot of stuff. Too much stuff.

This commit is contained in:
SirStendec 2015-05-17 19:02:57 -04:00
parent e1cfb17081
commit 576c9569b2
22 changed files with 1977 additions and 454 deletions

View file

@ -117,13 +117,27 @@ module.exports = {
return m;
},
time_to_string: function(elapsed) {
date_string: function(date) {
return date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate();
},
time_to_string: function(elapsed, separate_days, days_only) {
var seconds = elapsed % 60,
minutes = Math.floor(elapsed / 60),
hours = Math.floor(minutes / 60);
hours = Math.floor(minutes / 60),
days = "";
minutes = minutes % 60;
return (hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
if ( separate_days ) {
days = Math.floor(hours / 24);
hours = hours % 24;
if ( days_only && days > 0 )
return days + " days";
days = ( days > 0 ) ? days + " days, " : "";
}
return days + (hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
}
}