Skip to content

Commit

Permalink
Resolves issue with using de_DE (or others) locale w/ strftime output…
Browse files Browse the repository at this point in the history
… reported by @bag
  • Loading branch information
dannon committed Feb 16, 2016
1 parent 00b739f commit f9c3890
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/web/framework/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import time
from datetime import datetime, timedelta
from galaxy.util import hash_util
from galaxy.util import hash_util, unicodify
from galaxy.util.json import safe_dumps as dumps # noqa (used by mako templates)
from webhelpers import date
from webhelpers.html.tags import stylesheet_link, javascript_link
Expand All @@ -22,7 +22,7 @@ def time_ago( x ):

# If the date is more than one week ago, then display the actual date instead of in words
if (datetime.utcnow() - x) > delta: # Greater than a week difference
return x.strftime("%b %d, %Y")
return unicodify(x.strftime("%b %d, %Y"))
else:
date_array = date.distance_of_time_in_words( x, datetime.utcnow() ).replace(",", "").split(" ")
return "~%s %s ago" % (date_array[0], date_array[1])
Expand Down

0 comments on commit f9c3890

Please sign in to comment.