Sterling Rose Design Blog
Perpetual Footer
Authored by Dana Jones
May 10, 2009 21:39
2 Comments
Tags: date and time Rails
Leave a Comment
Authored by Dana Jones
May 10, 2009 21:39
2 Comments
Tags: date and time Rails
I was spinning up a brand new client website that would (like most websites) include a copyright footer. I wanted to make sure I wouldn’t have to come back year after year and update the year span, so here is what I used:
It will display only 2009 as the copyright year until January 1, 2010, then it will start displaying a span (from 2009 through the current year). Simple.
Uses Rails 2.3.2
Comments© 2009<%= "-#{Date.today.year}" if Date.today.year != 2009 %> ABC CompanyIt will display only 2009 as the copyright year until January 1, 2010, then it will start displaying a span (from 2009 through the current year). Simple.
Uses Rails 2.3.2
Guess I need to improve my Ruby-fu. ;)
Posted May 22, 2009 by Dana
Posted May 22, 2009 by Dana
Leave a Comment


Posted May 21, 2009 by iain