Created
June 27, 2012 06:28
-
-
Save Alxandr/3001946 to your computer and use it in GitHub Desktop.
Showing dates in Filemanager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts UNIX timestamps to dates. | |
var formatDate = function(date){ | |
function add0(n, l) { | |
var str = n.toString(); | |
while(str.length < l) | |
str = 0 + str; | |
return str; | |
} | |
var n = parseInt(date); | |
var d = new Date(n * 1000); | |
return add0(d.getDate(), 2) + "." + add0(d.getMonth() + 1, 2) + "." + d.getFullYear() + " " + add0(d.getHours(), 2) + ":" + add0(d.getMinutes(), 2); | |
} | |
/////////////////////////////////////// | |
/* Inside the getFolderInfo function */ | |
/////////////////////////////////////// | |
if(props['Date Modified'] && props['Date Modified'] != ''){ | |
result += '<td><abbr title="' + props['Date Modified'] + '">' + formatDate(props['Date Modified']) + '</abbr></td>'; | |
} else { | |
result += '<td></td>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment