2017-12-19 17:03:51 +01:00
|
|
|
|
|
|
|
function daysAgo(timestamp) {
|
|
|
|
var difference = Math.round(+new Date()/1000) - timestamp;
|
|
|
|
var daysDifference = Math.round(difference/60/60/24);
|
|
|
|
return "(" + daysDifference + " days ago)";
|
|
|
|
}
|
|
|
|
|
|
|
|
$(".daysAgo").each(function () {
|
|
|
|
var t = $(this).attr("timestamp");
|
2018-01-29 03:39:04 +01:00
|
|
|
var href = $(this).attr("href");
|
2017-12-19 17:03:51 +01:00
|
|
|
if (t) {
|
|
|
|
link = document.createElement('a');
|
2018-01-29 03:39:04 +01:00
|
|
|
link.setAttribute('href', href);
|
2017-12-19 17:03:51 +01:00
|
|
|
link.innerHTML = daysAgo(t);
|
|
|
|
this.appendChild(link);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".ci-app-test-result div[value=True]").addClass("success")
|
|
|
|
$(".ci-app-test-result div[value=False]").addClass("danger")
|