sbfaulkner / pretty_dates

Adds additional format specifiers to Time#strftime

This URL has Read+Write access

sbfaulkner (author)
Mon Aug 18 19:27:17 -0700 2008
commit  ffebb09e8b6c7fd35cf9e11e43749ddfec9b6d06
tree    7cb6d4960fb73be0d9b806ae4b2b66cc0b6c9da5
parent  986a3c93e1f5866b46fa2f5b6dce202195995a73
name age message
file MIT-LICENSE Loading commit data...
file README.markdown
file Rakefile
file init.rb
directory lib/
directory test/
README.markdown

PrettyDates

Adds additional format specifiers to Time#strftime.

%o = ordinalized day of month (e.g. 1st, 2nd, 3rd...) %D = day of month without leading zero %i = hour of day in 12-hour format without leading 0 %P = lower-case am/pm indicator

Example

Time::DATE_FORMATS[:long] = "%B %o, %Y at %i:%M %P %Z"
=> June 1st, 2008 at 9:43 am EST

Time::DATE_FORMATS[:short] = "%b %D %i:%M %P"
=> Jun 1 9:43 am

Installation

./script/plugin install git://github.com/sbfaulkner/pretty_dates.git

Legal

Author: S. Brent Faulkner brentf@unwwwired.net
License: Copyright © 2008 unwwwired.net, released under the MIT license