GithubHelp home page GithubHelp logo

Add formats about validates_timeliness HOT 8 CLOSED

adzap avatar adzap commented on July 17, 2024
Add formats

from validates_timeliness.

Comments (8)

adzap avatar adzap commented on July 17, 2024

Have set config.use_plugin_parser to true ?

On 07/12/2011, at 1:27 AM, [email protected] wrote:

i'm trying set a new date format..

config.parser,add_formats(:date, 'dd/mm/yyyy')

i'm still get error of invalid date.


Reply to this email directly or view it on GitHub:
#60

from validates_timeliness.

cmassao avatar cmassao commented on July 17, 2024

yes

2011/12/6 Adam Meehan <
[email protected]

Have set config.use_plugin_parser to true ?

On 07/12/2011, at 1:27 AM, [email protected] wrote:

i'm trying set a new date format..

config.parser,add_formats(:date, 'dd/mm/yyyy')

i'm still get error of invalid date.


Reply to this email directly or view it on GitHub:
#60


Reply to this email directly or view it on GitHub:

#60 (comment)

from validates_timeliness.

cmassao avatar cmassao commented on July 17, 2024

so.. it's a bug or i'm doing something wrong?

from validates_timeliness.

cmassao avatar cmassao commented on July 17, 2024

my code in validates_timeliness.rb

config.use_plugin_parser = true
config.parser.add_formats(:date, 'dd/mm/yyyy')

from validates_timeliness.

cmassao avatar cmassao commented on July 17, 2024

I tried specifying the format in the class, but still with the same error
:format => 'dd/mm/yyyy'

from validates_timeliness.

cmassao avatar cmassao commented on July 17, 2024

sorry, when i specify the format, the validates works, but on create, it's trying get the value on us format and creating a record with a nil value..

my date: '30/12/2011', it's save a nil value in date field, because the controller is trying get a us format date('m/d/yy').. i guess
when i create with this date: '12/12/2011', it works fine.

I do not know if I'm right, but thanks anyway

from validates_timeliness.

adzap avatar adzap commented on July 17, 2024

Damn. my reply from a few days ago didn't come through. You need

config.parser.use_euro_formats

because the format you are using is ambiguous with the US format.

from validates_timeliness.

cmassao avatar cmassao commented on July 17, 2024

thx adzap !

from validates_timeliness.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.