Skip to content

Commit

Permalink
Deprecated 'ago' and 'fromNow' options
Browse files Browse the repository at this point in the history
  * Use 'suffixAgo' and 'suffixFromNow' instead
  * Also upped version to 0.6.1
  • Loading branch information
rmm5t committed Oct 14, 2008
1 parent 6abc14d commit 3dde17c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jquery.timeago.js
@@ -1,5 +1,5 @@
/*
* timeago: a jQuery plugin, version: 0.6.0 (10/13/2008)
* timeago: a jQuery plugin, version: 0.6.1 (10/14/2008)
* @requires jQuery v1.2 or later
*
* Timeago is a jQuery plugin that makes it easy to support automatically
Expand All @@ -26,10 +26,12 @@
refreshMillis: 60000,
allowFuture: false,
strings: {
ago: "ago",
fromNow: "from now",
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from now",
ago: null, // DEPRECATED, use suffixAgo
fromNow: null, // DEPRECATED, use suffixFromNow
seconds: "less than a minute",
minute: "about a minute",
minutes: "%d minutes",
Expand All @@ -46,11 +48,11 @@
inWords: function(distanceMillis) {
var $l = this.settings.strings;
var prefix = $l.prefixAgo;
var suffix = $l.ago;
var suffix = $l.suffixAgo || $l.ago;
if (this.settings.allowFuture) {
if (distanceMillis < 0) {
prefix = $l.prefixFromNow;
suffix = $l.fromNow;
suffix = $l.suffixAgo || $l.fromNow;
}
distanceMillis = Math.abs(distanceMillis);
}
Expand Down

0 comments on commit 3dde17c

Please sign in to comment.