Comments (8)
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 = 30but 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.
Yes, I have that turned on: Please check out my init file below:
https://gist.github.com/1042561
from validates_timeliness.
How are you entering this date into the record?
from validates_timeliness.
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.
I mean are entering via a web form?
from validates_timeliness.
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:
from validates_timeliness.
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.
cool! Thanks!
from validates_timeliness.
Related Issues (20)
- No configuration required per thread (compatibility with timeliness 0.4.0+ HOT 7
- No support for midnight with :time type HOT 1
- NoMethodError: undefined method `deduplicate' with ActiveRecord 6.1 HOT 3
- Doesn't work with Ruby 3.0 / Rails 6.1 (PR attached) HOT 5
- Gem in 5.0.0 version not execute "timeliness" validations in ActiveRecord models HOT 12
- Update `CHANGELOG.rdoc` for v5.0.0 HOT 1
- Check time_zone_aware_types HOT 3
- Plans to release a official 6.x version HOT 3
- `add_error` call with wrong number of arguments HOT 2
- Issue on engine test load HOT 2
- ArgumentError: wrong number of arguments (given 3, expected 1..2) on records.error.add HOT 8
- Locale for Vietnamese HOT 2
- Rails 7 Deprecation Warnings HOT 6
- Rails 7 dependency - activemodel HOT 4
- Please support Rails 7 then cut a new version HOT 1
- Additional maintainer needed HOT 2
- Support for Rails 7 HOT 4
- Is there any way that I can make sure that ranges are exclusive?
- Handle when the passed value is not a Date value. when it's a Numeric
- Comparison to ComparisonValidator HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validates_timeliness.