Joined July 2012
·

Justin Schier

New York, NY
·
·

Posted to Display date ranges in text in Rails over 1 year ago

Thanks for this! There's a small bug though: If your dates are Feb 10, 2014 - Feb 10, 2015, the result will be incorrect. You need to change

if from_date.month == until_date.month

to

if from_date.month == until_date.month && from_date.year == until_date.year
Achievements
1 Karma
0 Total ProTip Views
Interests & Skills