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 @@ -31,4 +31,14 @@ :action => action) end + def format_short_time(time) + now = Time.now + st = '' + if (time.yday != now.yday) or + (time.year != now.year) + st = time.strftime("%x ") + end + st + time.strftime("%X") + end + end