commit/galaxy-central: guerler: Webhelpers: Shorten time ago string
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/c5caf4ce55aa/ Changeset: c5caf4ce55aa User: guerler Date: 2014-01-25 06:07:12 Summary: Webhelpers: Shorten time ago string Affected #: 1 file diff -r 4362d887f48fe1891f46fc1ee435045b79c3779a -r c5caf4ce55aa0102b85032805ddd50445cb03002 lib/galaxy/web/framework/helpers/__init__.py --- a/lib/galaxy/web/framework/helpers/__init__.py +++ b/lib/galaxy/web/framework/helpers/__init__.py @@ -28,7 +28,8 @@ if (datetime.utcnow() - x) > delta: # Greater than a week difference return x.strftime("%b %d, %Y") else: - return date.distance_of_time_in_words( x, datetime.utcnow() ).replace("about", "~") + " ago" + date_array = date.distance_of_time_in_words( x, datetime.utcnow() ).replace(",", "").split(" ") + return "~%s %s ago" % (date_array[0], date_array[1]) def iff( a, b, c ): """ Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org