Here’s a little helper for UK Rails users when formatting a Date or DateTime object in your view.
I looked around for quite a while before I discovered the term ‘ordinalize’, so I hope this helps someone. Dates can be so America-centric sometimes (no hard feelings, State–side homeboys).
def nice_date(date)
# formats date like: 30th September 2009
date.strftime("#{date.day.ordinalize} %B %Y")
end
I’ll refine this one soon…
def fake_tv_northerner(text)
text = "t'".concat(text)
end