Created
November 3, 2009 22:58
-
-
Save ultraspeed/225550 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
# Changes the default date and time string formatters in Rails. See http://j.mp/2nZ022 and http://j.mp/1BRFSf for more info | |
# | |
# >> Time.now.to_s | |
# => "3rd Nov, 2009 10:54 PM GMT" | |
# >> Date.today.to_s | |
# => "3rd Nov, 2009" | |
Time::DATE_FORMATS[:default] = lambda { |time| time.strftime("#{time.day.ordinalize} %b, %Y %I:%M %p %Z") } | |
Date::DATE_FORMATS[:default] = lambda { |date| date.strftime("#{date.day.ordinalize} %b, %Y") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment