GithubHelp home page GithubHelp logo

2 year dates about validates_timeliness HOT 8 CLOSED

adzap avatar adzap commented on July 17, 2024
2 year dates

from validates_timeliness.

Comments (8)

adzap avatar adzap commented on July 17, 2024

Do you have the plugin parser switched on?

On 23/06/2011, at 4:09 AM, [email protected] wrote:

Hi,

Thanks for this great gem.

I have a little problem using it, but it could be implementation error. Basically, when people enter a 2 digit year, for example 1/1/86, it keeps gets saved as 0086-1-1. I can't seem to get the century in there. I have played with the initializer file, and uncommented this line:
config.parser.ambiguous_year_threshold = 30

but nothing.

Am I missing something?

I'm using ruby 1.8.7 and rails 3.0.7.

Thank you!

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

from validates_timeliness.

rkamun1 avatar rkamun1 commented on July 17, 2024

Yes, I have that turned on: Please check out my init file below:
https://gist.github.com/1042561

from validates_timeliness.

adzap avatar adzap commented on July 17, 2024

How are you entering this date into the record?

from validates_timeliness.

rkamun1 avatar rkamun1 commented on July 17, 2024

1/1/11 for example.

On Jun 24, 2011 6:02 AM, "adzap" <
[email protected]>
wrote:

How are you entering this date into the record?

Reply to this email directly or view it on GitHub:
#48 (comment)

from validates_timeliness.

adzap avatar adzap commented on July 17, 2024

I mean are entering via a web form?

from validates_timeliness.

rkamun1 avatar rkamun1 commented on July 17, 2024

yes, via webform on rails

On Fri, Jun 24, 2011 at 6:28 AM, adzap <
[email protected]>wrote:

I mean are entering via a web form?

Reply to this email directly or view it on GitHub:

#48 (comment)

from validates_timeliness.

adzap avatar adzap commented on July 17, 2024

If you are using select helpers then you need to turn on the plugin extension which uses the parser.

config.enable_multiparameter_extension!

If you are using a text field, then you need to override the writer method for the attribute in the model. In the custom writer method use the parser directly before the built-in ActiveRecord parsing methods do it for you. See the Timeliness gem for how to use the parser http://github.com/adzap/timeliness

from validates_timeliness.

rkamun1 avatar rkamun1 commented on July 17, 2024

cool! Thanks!

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.