mirror of
https://github.com/scratchfoundation/jquery-timeago.git
synced 2025-02-16 16:10:54 -05:00
Leave the contents alone if the timestamp is bunk
This commit is contained in:
parent
de1340dc0a
commit
c493a5eea6
2 changed files with 5 additions and 2 deletions
|
@ -66,7 +66,9 @@
|
|||
|
||||
function refresh() {
|
||||
var date = $.timeago.parse(this.title);
|
||||
$(this).text($.timeago.inWords(distance(date)));
|
||||
if (!isNaN(date)) {
|
||||
$(this).text($.timeago.inWords(distance(date)));
|
||||
}
|
||||
}
|
||||
|
||||
function distance(date) {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<h2>Short term</h2>
|
||||
You opened this page <abbr class="loaded timeago">sometime before now</abbr>.<br />
|
||||
This page was last modified <abbr class="modified timeago">sometime before now</abbr>.<br />
|
||||
This page was last modified <abbr class="modified timeago">sometime before now (your browser might not support document.lastModified for local resources)</abbr>.<br />
|
||||
|
||||
<h2>Long term</h2>
|
||||
Jett was born <abbr class="timeago" title="2008-02-27T00:23:00Z">bleh</abbr> [from Z]<br />
|
||||
|
@ -52,6 +52,7 @@
|
|||
<h2>Errors</h2>
|
||||
Bad (letters): <abbr class="timeago" title="bleh">(this should be displayed)</abbr>.<br />
|
||||
Bad (numbers): <abbr class="timeago" title="1234">(this should be displayed)</abbr>.<br />
|
||||
Bad (blank): <abbr class="timeago" title="">(this should be displayed)</abbr>.<br />
|
||||
Bad (missing): <abbr class="timeago">(this should be displayed)</abbr>.<br />
|
||||
|
||||
<h1>Parsing unit tests:</h1>
|
||||
|
|
Loading…
Reference in a new issue