crispgm/holy-images

View on GitHub
app/helpers/time_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
module TimeHelper
  def format_time(t)
    formatted = t.strftime("%H:%M") + " "
    unless t.today?
      unless t.this_year?
        formatted << t.strftime("%Y-%m-%d")
      else
        formatted << t.strftime("%m-%d")
      end
    end

    formatted
  end
end