[Rails] Re: Displaying a date 'properly'....

2009-10-23 Thread saravanan bava
Hi try this this will work for u european_date = '%d/%m/%Y' @date = a_date.strftime(european_date) Thanks Bava On Fri, Oct 23, 2009 at 2:06 AM, Robert Walker < rails-mailing-l...@andreas-s.net> wrote: > > Robb Shecter wrote: > > I put something like this in one of my helpers: > > > > def form

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread Robert Walker
Robb Shecter wrote: > I put something like this in one of my helpers: > > def format_date(a_date) > a_date.strftime("%B #{a_date.day}, %Y") > end > > Should give you a starting point. Personally, I like the pattern of having separate formatter classes, but using view helpers isn't too

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread lix
try this: http://l1xl1x.blogspot.com/2009/10/custom-date-and-time-format-in-rails.html Regards, Istvan On Oct 22, 6:47 pm, RubyonRails_newbie wrote: > Does anyone know how to implement this? > > On 22 Oct, 18:27, Frederick Cheung wrote: > > > > > On Oct 22, 6:01 pm, RubyonRails_newbie > > wro

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread RubyonRails_newbie
Excellent - sorted. Thanks Robb. I've amended it slightly, to have it as dd month year, but it's looking good now. Thanks for your help dude! I'm new to rails - and havent covered this so appreciate the help. On 22 Oct, 19:41, Robb wrote: > > so, if I put: > > >  def format_date(a_date)... > >

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread Robb
> so, if I put: > >  def format_date(a_date)... > ...in one of my helpers, what do I need to include in the rhtml page? > You could use it like this: Profile was created at <%= format_date(profile.created_at) %> --~--~-~--~~~---~--~~ You received this message

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread RubyonRails_newbie
so, if I put: def format_date(a_date) > a_date.strftime("%B #{a_date.day}, %Y") > end in one of my helpers, what do I need to include int he rhtml page? On 22 Oct, 18:57, Robb wrote: > I put something like this in one of my helpers: > >   def format_date(a_date) >      a_date.strftime("

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread Robb
I put something like this in one of my helpers: def format_date(a_date) a_date.strftime("%B #{a_date.day}, %Y") end Should give you a starting point. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread RubyonRails_newbie
Does anyone know how to implement this? On 22 Oct, 18:27, Frederick Cheung wrote: > On Oct 22, 6:01 pm, RubyonRails_newbie > wrote: > > > However. When this is saved to the database it looks like: 1988-10-01. > > Likewise on the site a user will eventually see. If they originally > > enter it a

[Rails] Re: Displaying a date 'properly'....

2009-10-22 Thread Frederick Cheung
On Oct 22, 6:01 pm, RubyonRails_newbie wrote: > However. When this is saved to the database it looks like: 1988-10-01. > Likewise on the site a user will eventually see. If they originally > enter it as: 01/10/1988, why does it display backwards? > > And, is there a solution to this to allow i