Skip to content

Commit

Permalink
Merge pull request #119 from kiafaldorius/localeTitle
Browse files Browse the repository at this point in the history
add setting to set the title to Date#toLocaleString
  • Loading branch information
rmm5t committed Mar 20, 2013
2 parents 783066c + fb40358 commit 4dad17f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jquery.timeago.js
Expand Up @@ -40,6 +40,7 @@
settings: {
refreshMillis: 60000,
allowFuture: false,
localeTitle: false,
strings: {
prefixAgo: null,
prefixFromNow: null,
Expand Down Expand Up @@ -160,7 +161,9 @@
if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text());
if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
if ($t.settings.localeTitle) {
element.attr("title", element.data('timeago').datetime.toLocaleString())
} else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
element.attr("title", text);
}
}
Expand Down

0 comments on commit 4dad17f

Please sign in to comment.