Replacing month numbers with abbreviations to be a bit more international

This commit is contained in:
John Campbell
2013-10-18 23:27:47 -04:00
parent 17f1a5f299
commit bfa83504fd

View File

@@ -365,8 +365,9 @@ $(function(){
return $html;
}
function formatTimestamp(unix_timestamp) {
var m = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var d = new Date(unix_timestamp*1000);
return [d.getMonth()+1,'/',d.getDate(),'/',d.getFullYear()," ",
return [m[d.getMonth()],' ',d.getDate(),', ',d.getFullYear()," ",
(d.getHours() % 12 || 12),":",(d.getMinutes() < 10 ? '0' : '')+d.getMinutes(),
" ",d.getHours() >= 12 ? 'PM' : 'AM'].join('');
}