Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add setting to set the title to Date#toLocaleString #119

Merged
merged 1 commit into from

2 participants

@kiafaldorius

No description provided.

@rmm5t rmm5t merged commit 4dad17f into from
@rmm5t
Owner

Thanks! Good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2013
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 jquery.timeago.js
View
5 jquery.timeago.js
@@ -40,6 +40,7 @@
settings: {
refreshMillis: 60000,
allowFuture: false,
+ localeTitle: false,
strings: {
prefixAgo: null,
prefixFromNow: null,
@@ -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);
}
}
Something went wrong with that request. Please try again.