diff --git a/lsp/functions.js b/lsp/functions.js index 30ba1a0f..0a840c3b 100644 --- a/lsp/functions.js +++ b/lsp/functions.js @@ -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('/') + ' ' + [ @@ -27,6 +27,31 @@ ('00' + d.getSeconds()).slice(-2) ].join(':'); } + + + /** + * 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'); + } /** diff --git a/lsp/main.js b/lsp/main.js index a5f1b5f5..89568506 100644 --- a/lsp/main.js +++ b/lsp/main.js @@ -136,7 +136,7 @@ }else{ setHeaderState('disconnected'); $('#header-host').text(''); - $('#page').append($('
').text(errorstr)); + $('#page').append($('
').text(errorstr)); } }); }).text('login'); @@ -187,7 +187,7 @@ ) ).append( $('