strike out when data is old

This commit is contained in:
Ben West
2014-07-26 14:56:24 -07:00
parent 9b79e75e48
commit aac2dcf886
+11 -1
View File
@@ -28,6 +28,11 @@
min-height: 100%;
}
.stale {
text-decoration: line-through;
}
</style>
</head>
<body>
@@ -43,7 +48,12 @@
function render (xhr) {
console.log('xhr', xhr);
$('.bgnow').text(xhr[0].sgv);
var rec = xhr[0];
var last = new Date(rec.date);
var now = new Date( );
$('.bgnow').text(rec.sgv);
var threshold = 1000 * 60 * 13;
$('.bgnow').toggleClass('stale', (now - last > threshold));
}
function init ( ) {