Created
August 3, 2012 19:42
-
-
Save huned/3250803 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
| >> Timecop.freeze Time.parse('January 1, 2012') | |
| => 2012-01-01 00:00:00 -0800 | |
| >> Time.parse('January 1, 2011').to_s(:activity) | |
| => "January 2011" | |
| >> Time.parse('February 1, 2011').to_s(:activity) | |
| => "February 2011" | |
| >> Time.parse('March 1, 2011').to_s(:activity) | |
| => "March" | |
| >> Time.parse('January 1, 2012').to_s(:activity) | |
| => "Today" | |
| >> Time.parse('December 1, 2011').to_s(:activity) | |
| => "Last Month" | |
| >> Time.parse('December 30, 2011').to_s(:activity) | |
| => "Friday" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment