Created
July 15, 2013 10:34
-
-
Save elvio/5999040 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original | |
------------------------------------------------------------ | |
9 + <% t = first.starts_at %> | |
10 + <% if t.today? %> | |
11 + <%= I18n.t("landing.today") %> | |
12 + <% elsif t.tomorrow? %> | |
13 + <%= I18n.t("landing.tomorrow") %> | |
14 + <% else %> | |
15 + <%= I18n.l t, :format => :short %> | |
16 + <% end %> | |
Suggestion | |
------------------------------------------------------------ | |
def human_date(date) | |
if date.today? | |
I18n.t("landing.today") | |
elsif date.tomorrow? | |
I18n.t("landing.tomorrow") | |
else | |
I18n.l t, :format => :short | |
end | |
end | |
<span class="bc-time"><%= human_date(first.starts_at) %></span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment