Rails: Predefining date formats
To have a predefined set of date formats (e.g. to make a short version looking like 11/2009 and a long version displaying 01.11.2009 or 2009/11/01) you can define them in config/environment.rb, right after the final end notation:
Time::DATE_FORMATS[:short] = “%d.%m.%Y at %H:%M”Time::DATE_FORMATS[:news] = “%d.%m.%y”
Share this on:
Read More