From 644e63e52e828e76e7f6d3cd3ef0d9026bcee007 Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Mon, 4 Jan 2010 12:43:13 -0500 Subject: [PATCH] Fix for `time` tag in HTML 5 `time` when using IE <8 [treyp] --- jquery.timeago.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index 9fd0284..2696980 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -85,7 +85,9 @@ return new Date(s); }, datetime: function(elem) { - var iso8601 = $(elem).is('time') ? $(elem).attr('datetime') : $(elem).attr('title'); + // jQuery's `is()` doesn't play well with HTML5 in IE + var isTime = $(elem).get(0).tagName.toLowerCase() == 'time'; // $(elem).is('time'); + var iso8601 = isTime ? $(elem).attr('datetime') : $(elem).attr('title'); return $t.parse(iso8601); } });