jeremyw/stamp — Issue #9: Allow ordinal numbers
Author: chrisledet
Created: 2011-11-06 01:19:33+00:00
State: open

I wanted to get your thoughts and maybe some ideas on how to implement this. I tried implementing it in my fork on Friday for a few hours but I just couldn't get it to work. (although regex isn't my forte)

Ideally, I would like to be able to do something like:

Time.now.stamp("31st Oct 2012")
# => "5th Nov 2012"

or even

Time.now.stamp("Oct 2nd 2012")
# => "Nov 5th 2012"

Stamp is built as a parser for strftime formats and currently Ruby's strftime doesn't support ordinals in the date. That's what it's so difficult to write it. =/

Let me know what you think.