Permalink
Browse files

Fixed #7. Add the prefix's ago support. And update hte version to 0.1.1

  • Loading branch information...
1 parent 6f104ff commit 3febf136761f8515b97a9b9c31b3a0ce92420c8c @poshboytl poshboytl committed Aug 24, 2012

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -2,8 +2,9 @@
// https://pragmatic.ly/
// Licensed under the MIT license.
// https://github.com/pragmaticly/smart-time-ago/blob/master/LICENSE
-
+//
// Generated by CoffeeScript 1.3.3
+
(function() {
var TimeAgo;
@@ -83,7 +84,7 @@
TimeAgo.prototype.timeAgoInWords = function(timeString) {
var absolutTime;
absolutTime = this.parse(timeString);
- return this.distanceOfTimeInWords(absolutTime) + ("" + this.options.lang.suffix);
+ return "" + this.options.lang.prefixes.ago + (this.distanceOfTimeInWords(absolutTime)) + this.options.lang.suffix;
};
TimeAgo.prototype.parse = function(iso8601) {
@@ -184,7 +185,8 @@
lt: "less than a",
about: "about",
over: "over",
- almost: "almost"
+ almost: "almost",
+ ago: ""
},
suffix: ' ago'
}
@@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang =
about: "about"
over: "over"
almost: "almost"
+ ago: ""
suffix: " ago"
@@ -17,5 +17,6 @@ $.fn.timeago.defaults.lang =
about: "cerca de"
over: "poco más de"
almost: "casi"
+ ago: "hace "
suffix: ""
@@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang =
about: "environ"
over: "plus de "
almost: "presque"
+ ago: "il y a "
suffix: ""
@@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang =
about: "aproximadamente"
over: "pouco mais de"
almost: "quase"
+ ago: ""
suffix: " atrás"
@@ -17,4 +17,5 @@ $.fn.timeago.defaults.lang =
about: "大约"
over: "超过"
almost: "接近"
+ ago: ""
suffix: "之前"
View
@@ -1,4 +1,4 @@
-# Smart Time Ago v0.1.0
+# Smart Time Ago v0.1.1
# Copyright 2012, Terry Tai, Pragmatic.ly
# https://pragmatic.ly/
@@ -65,7 +65,7 @@ class TimeAgo
timeAgoInWords: (timeString) ->
absolutTime = @parse(timeString)
- @distanceOfTimeInWords(absolutTime) + "#{@options.lang.suffix}"
+ "#{@options.lang.prefixes.ago}#{@distanceOfTimeInWords(absolutTime)}#{@options.lang.suffix}"
parse: (iso8601) ->
timeStr = $.trim(iso8601)
@@ -147,5 +147,6 @@ $.fn.timeago.defaults =
about: "about"
over: "over"
almost: "almost"
+ ago: ""
suffix: ' ago'

0 comments on commit 3febf13

Please sign in to comment.