[LRUG] How does Rails decide how to parse ambiguous dates?

John Winters john at sinodun.org.uk
Tue Jul 26 09:43:08 PDT 2011


On 26/07/11 17:36, Matthew Rudy Jacobs wrote:
>
>     Because I have some fairly naive users, and getting them to use a
>     computer at all can be a bit of a struggle.  Seriously - I have
>     users whose tension levels go through the roof if even asked to sit
>     at a keyboard.  Asking them to adapt to a new date format is just
>     too much.
>
> I suggest to use names of months, instead of month numbers then
>
> "20" + "September" + "2012"
>
> is unambiguous, and user-friendly, in america and the uk.

Yes, that's a nice idea, but it still leaves unanswered the question of 
how to get an existing date formatted like that in the text field.

As far as I've been able to discover, Rails provides no facilities to 
control that formatting, and what you'll get in your field by default is 
the raw database format.  Obviously there are lots of ways of overriding 
this, but what I've been trying to do is find the Correct Rails Way(TM) 
to achieve it.

The best I've come up with so far is the ":value => ..." way I detailed 
earlier.  I'm surprised the framework doesn't provide anything better, 
but I'll keep looking for a while longer just in case.

Cheers,
John



More information about the Chat mailing list