From eee58806aab9c20efb064e0eed8a06b8e52aac00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20de=20Giessen?= Date: Wed, 12 Jun 2013 13:25:52 +0300 Subject: [PATCH] Added support for updating locale titles The 'update' method now also updates the "title"-attribute when 'localeTitle' is enabled. --- jquery.timeago.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index bdc5427..0caa0f4 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -132,7 +132,9 @@ } }, update: function(time){ - $(this).data('timeago', { datetime: $t.parse(time) }); + var parsedTime = $t.parse(time); + $(this).data('timeago', { datetime: parsedTime }); + if($t.settings.localeTitle) $(this).attr("title", parsedTime.toLocaleString()); refresh.apply(this); } };