LSP - fixes regarding wrong date display and increased width of the editserver div

This commit is contained in:
cat 2013-01-08 19:23:40 +01:00 committed by Thulinma
parent 4a15dff758
commit 2f9ccf366f
3 changed files with 37 additions and 10 deletions

View file

@ -16,9 +16,9 @@
function formatDate(date)
{
var d = new Date(date * 1000);
// note: .getMonth() returns the month from 0-11
return [
('00' + d.getMonth()).slice(-2),
('00' + (d.getMonth()+1)).slice(-2),
('00' + d.getDate()).slice(-2),
d.getFullYear()
].join('/') + ' ' + [
@ -29,6 +29,31 @@
}
/**
* Format a date to mmm dd /yyyy hh:mm:ss format
* @param date the date to format (timestamp)
*/
months = Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
function formatDateLong(date)
{
var d = new Date(date * 1000);
return [
months[d.getMonth()],
('00' + d.getDate()).slice(-2),
d.getFullYear()
].join(' ') + ' ' + [
('00' + d.getHours()).slice(-2),
('00' + d.getMinutes()).slice(-2),
('00' + d.getSeconds()).slice(-2)
].join(':');
}
function nameMonth(monthNum)
{
months = Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
}
/**
* Find out what kind of resource an URI is
* @param uri the URI to check. If it start with a protocol (ebut not file://) return 'Live', else 'Recorded'

View file

@ -136,7 +136,7 @@
}else{
setHeaderState('disconnected');
$('#header-host').text('');
$('#page').append($('<p>').text(errorstr));
$('#page').append($('<p>').text(errorstr));
}
});
}).text('login');
@ -187,7 +187,7 @@
)
).append(
$('<label>').text('time').append(
$('<span>').text( formatDate(settings.settings.config.time) )
$('<span>').text( formatDateLong(settings.settings.config.time) )
)
).append(
$('<label>').text('Streams').append(
@ -1018,7 +1018,7 @@
case 'logs':
$table = $('<table>');
$table.html("<thead><th>Date<span class='theadinfo'>(MM/DD/YYYY)</span></th><th>Type</th><th>Message</th></thead>");
$table.html("<thead><th>Date<span class='theadinfo'>(MMM DD YYYY)</span></th><th>Type</th><th>Message</th></thead>");
$tbody = $('<tbody>');
if(!settings.settings.log)
@ -1041,7 +1041,7 @@
cur = settings.settings.log[i];
$tr = $('<tr>').append(
$('<td>').text(formatDate(cur[0]))
$('<td>').text(formatDateLong(cur[0]))
).append(
$('<td>').text(cur[1])
).append(

View file

@ -245,7 +245,7 @@ label
display: block;
margin: 6px 0 9px 0;
padding: 8px 0 0 0;
width: 400px;
width: 600px;
}
label input,
@ -264,7 +264,7 @@ label span
#editserver
{
width: 400px;
width: 600px;
float: left;
}
@ -372,9 +372,9 @@ td
#forcesave
{
width: 400px;
width: 600px;
float: left;
margin: 0 0 0 100px;
margin-top:20px;
}
#forcesave button
@ -385,6 +385,8 @@ td
#forcesave p
{
text-transform: none;
width:500px;
float:right;
}