reed
February 9, 2007, 2:40am
1
I am trying to format some datetimes like this…2007, February the
9th, 6:30pm
I have the following which gets me part way there.
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update(:my_date_format
=> “%Y, %d %B, %I:%M%p”)
There are 2 problems
There is no “th” formatter so that I get 1st, 2nd, 3rd, 4th, 5th,
etc.
PM is in uppercase and I would prefer it in lower.
TIA
reed
February 9, 2007, 4:39am
2
On Feb 8, 2007, at 8:40 PM, reed wrote:
There is no “th” formatter so that I get 1st, 2nd, 3rd, 4th, 5th,
etc.
PM is in uppercase and I would prefer it in lower.
TIA
Roll your own a bit:
http://api.rubyonrails.org/classes/Inflector.html#M001091
(part of ActiveSupport)
Just .downcase the AM/PM
You’re asking on the Ruby list, but you clearly have ActiveSupport.
If this is more of a Rails question, you may get more response on the
Rails list ([email protected] ).
-Rob
Rob B. http://agileconsultingllc.com
[email protected]
reed
February 9, 2007, 6:50am
3
On Feb 9, 4:38 pm, Rob B. [email protected] wrote:
(part of ActiveSupport)
[email protected]
Thanks for that, I will repost on the rails group.