add script to show local time

Signed-off-by: 王邈 <shankerwangmiao@gmail.com>
This commit is contained in:
王邈 2017-09-02 01:13:27 +08:00
parent b01402c35a
commit 178f579e49
No known key found for this signature in database
GPG Key ID: B031E3CA7BFED96E

View File

@ -19,6 +19,19 @@ permalink: /fancy-index/after.html
<script>
document.getElementById("list").setAttribute("class", "table");
document.title = "Index of " + location.pathname + " | " + document.title;
$(function(){
$("#list tbody tr td:nth-child(3)").each(function(k,date){
var d = new Date($(date).text());
if(!isNaN(d.getTime())){
var date_str = ('000' + d.getFullYear()).substr(-4) + "-"
+ ('0' + (d.getMonth() + 1)).substr(-2) + "-"
+ ('0' + d.getDate()).substr(-2)
+ (" " + ('0' + d.getHours()).substr(-2) + ":"
+ ('0' + d.getMinutes()).substr(-2));
$(date).text(date_str);
}
})
});
</script>
<style>
#list tbody td, #path{