Convert unix timestamp to localized date string on manage room page

master
Daniel Berteaud 10 years ago
parent 94d186045e
commit 3a6106aac4
  1. 14
      public/js/vroom.js

@ -224,6 +224,12 @@ function getTime(){
return hours + ':' + minutes + ':' + seconds; 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 // Temporarily suspend a button, prevent abuse
function suspendButton(el){ function suspendButton(el){
$(el).attr('disabled', true); $(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 // This is the main function called when you join a room
function initVroom(room) { function initVroom(room) {

Loading…
Cancel
Save