diff --git a/public/js/vroom.js b/public/js/vroom.js index b009224..f680992 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -224,6 +224,12 @@ function getTime(){ return hours + ':' + minutes + ':' + seconds; } +// Convert a timestamp to readable date +function timeStamp2Date(sec){ + var d = new Date(sec*1000); + return d.toLocaleString(); +} + // Temporarily suspend a button, prevent abuse function suspendButton(el){ $(el).attr('disabled', true); @@ -302,6 +308,14 @@ function initIndex(){ }); } +// Used on the management page +function initManage(){ + // Replace timestamps with a readable date + $('.timeStamp').each(function(){ + $(this).html(timeStamp2Date(parseInt($(this).html()))); + }); +} + // This is the main function called when you join a room function initVroom(room) {