Created
September 10, 2014 10:41
-
-
Save h2ero/9443ec5321549994da01 to your computer and use it in GitHub Desktop.
This file contains 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
$(function(){ | |
var timeCol = ['creation_time','timestamp','payment_time', 'delivery_time','target_shipping_time']; | |
console.log(timeCol); | |
var ths = $('#right table tr:first th'); | |
console.log(ths); | |
ths.each(function(index){ | |
timeColElIndex = timeCol.indexOf($(this).text()); | |
if(timeColElIndex !== -1){ | |
$('#right table tr').each(function(){ | |
var timeEl = $('td:eq('+index+')', $(this)); | |
var time = timeEl.text(); | |
var date = new Date(time*1000); | |
var dateTime = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes() +':'+ date.getSeconds(); | |
$(timeEl).html('<a>'+dateTime+'</a>'); | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment