summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-12-16 01:25:03 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-12-16 01:25:03 +0100
commitfd83bd02e2b82457e0a49214e075173505ebe994 (patch)
tree9a08d177e5fd3ebd3f20abb9088ba02d03c09c92
parentba42283d7cfe895a6604ce64f6e3399eb54fa2d3 (diff)
utils.rb: fix Utils.timeago for explicit date output
-rw-r--r--lib/rbot/core/utils/utils.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb
index 864426b0..5af26b69 100644
--- a/lib/rbot/core/utils/utils.rb
+++ b/lib/rbot/core/utils/utils.rb
@@ -244,7 +244,7 @@ module ::Irc
# :date_format, used with <tt>to_formatted_s<tt>, default to :default
def Utils.timeago(time, options = {})
start_date = options.delete(:start_date) || Time.new
- date_format = options.delete(:date_format) || :default
+ date_format = options.delete(:date_format) || "%x"
delta_minutes = (start_date.to_i - time.to_i).floor / 60
if delta_minutes.abs <= (8724*60) # eight weeks? I'm lazy to count days for longer than that
distance = Utils.distance_of_time_in_words(delta_minutes);
@@ -254,7 +254,7 @@ module ::Irc
_("%{d} ago") % {:d => distance}
end
else
- return _("on %{date}") % {:date => system_date.to_formatted_s(date_format)}
+ return _("on %{date}") % {:date => time.strftime(date_format)}
end
end
# Translates a number of minutes into verbal distances.