Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date format in text field #8

Closed
ssk opened this issue Apr 2, 2013 · 2 comments
Closed

Date format in text field #8

ssk opened this issue Apr 2, 2013 · 2 comments

Comments

@ssk
Copy link

ssk commented Apr 2, 2013

I use american_date gem in my rails 3.0 application.
Ruby is 1.9.3

Everything works as expected except for input field.
It shows 2013-04-02 style.

I have the following configuration in initialize directory.
Time::DATE_FORMATS[:default] = "%m/%d/%Y %H:%M:%S"
Date::DATE_FORMATS[:default] = '%m/%d/%Y'

How do I fix it?

Sam

@jeremyevans
Copy link
Owner

american_date only deals with parsing dates, not with display of dates. You would probably have exactly the same issues if you don't use american_date (try removing the use of american_date temporarily to confirm).

You probably need to ask on a Rails list why your Rails code isn't working. My guess is your input field isn't using DATE_FORMATS[:default] to display the date.

@ssk
Copy link
Author

ssk commented Apr 3, 2013

You're right. I thought using the gem would change the display of input.
Thanks.

On Tue, Apr 2, 2013 at 5:22 PM, Jeremy Evans notifications@github.comwrote:

american_date only deals with parsing dates, not with display of dates.
You would probably have exactly the same issues if you don't use
american_date (try removing the use of american_date temporarily to
confirm).

You probably need to ask on a Rails list why your Rails code isn't
working. My guess is your input field isn't using DATE_FORMATS[:default]to display the date.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-15810995
.

Sam S. Kong
President & CEO
sam@designpremise.com
818-653-1351 sam@designpremise.com

[image: http://www.samanne.com/logo/logo_s.jpg]http://www.designpremise.com/

DESIGN PREMISE *(DBA of Sam & Anne, Inc.)
*680 Wilshire Pl. #302, Los Angeles, CA 90005
http://www.designpremise.com/www.DesignPremise.comhttp://www.designpremise.com/
http://www.designpremise.com/Web Consulting & Development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants