diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -85,11 +85,10 @@ end def format_short_time(time) - now = Time.now.gmtime + now = Time.zone.now st = '' - if (time.yday != now.yday) or - (time.year != now.year) - st = time.strftime("%x ") + if (time.yday != now.yday) or (time.year != now.year) + st = time.strftime("%d/%m/%y ") end st + time.strftime("%X") end @@ -100,6 +99,10 @@ return Time.at(d).gmtime.strftime("%X") end + def format_full_time_ago(time) + st = time_ago_in_words(time) + ' ago (' + format_short_time(time) + ')' + end + def read_textfile(fname,max_size=2048) begin File.open(fname).read(max_size)