Date fields #46
Replies: 1 comment
-
Google Group Date: Mon, 19 May 2014 17:22:43 -0700 On Monday, May 19, 2014 2:33:10 PM UTC-7, Dave Howell wrote:
Look at the html_usa serializer, which will switch the serialization to use Thanks, |
Beta Was this translation helpful? Give feedback.
-
Google Group Post: https://groups.google.com/g/ruby-forme/c/RopRYYqywZU
Google Group Date: Mon, 19 May 2014 14:33:10 -0700
Google Group Sender: [email protected]
On my old form, my sales date came back looking like this:
Forme is giving me this:
Forme, of course, is doing it properly. (I need to look into why the time zone is wrong…) I was thinking “wait, what? I mean, yea, I like having just the date, but it is a datetime field, so what happened to the rest of it?”
It didn’t take me long to find
in my code. Fine and dandy.
BUT!
I would like to have my datetimes show up in something more readable than the default. I looked at formatters, but I couldn’t find an example for how to extend the class.
I did rewrite the existing format_datetime method, adding
That worked, but I’m sure that’s not the ‘right’ way to do it. (For one thing, it’s going to truncate the seconds whether or not the user changes the field.) How do you think this should be handled? I don’t particularly want to use the :as=>:select here.
Beta Was this translation helpful? Give feedback.
All reactions