Commit Graph

170 Commits

Author SHA1 Message Date
Adam Meehan
32621ceebe added restriction value error message formats as global accessor for customisation
added each invalid type to error messages rather than shortcut way
2008-07-25 19:21:30 +10:00
Adam Meehan
608f3b569f more date value standardisation 2008-07-25 19:19:47 +10:00
Adam Meehan
24db8ab774 changed to using accessor for model instance and using specific validation method for each type 2008-07-25 19:17:55 +10:00
Adam Meehan
5567f920f7 standardising test values 2008-07-24 18:55:20 +10:00
Adam Meehan
698ea29ff7 removed references to pluggable parser not going to bother with it, too compromising 2008-07-23 20:41:24 +10:00
Adam Meehan
59caa86618 changed spec to be like rails behaviour 2008-07-23 20:40:34 +10:00
Adam Meehan
69ac9e678d using date and time string convert methods from validates_date_time plugin which handles different array lengths 2008-07-23 20:39:25 +10:00
Adam Meehan
55333d6ca3 standardising test date values 2008-07-23 20:38:18 +10:00
Adam Meehan
776e3008d2 added extra check to see if time zone attributes in enabled 2008-07-23 12:43:42 +10:00
Adam Meehan
5c03d3d645 added define_write_method with simple parse and cace for dates, times and datetimes when time zone conversion is off and default for Rails 2.0 2008-07-23 12:42:03 +10:00
Adam Meehan
7500781887 added compile_set method to get expressions and combine date and datetime expressions to allow a date string to parse when type is datetime
made internal methods private
2008-07-23 12:39:20 +10:00
Adam Meehan
85ac2bfc69 changed method to check type and compose string for specific type to properly validate
refactored specs
2008-07-23 12:35:42 +10:00
Adam Meehan
057014fcb2 added more benchmarks for special cases 2008-07-23 12:35:06 +10:00
Adam Meehan
2be6c639d6 changed 2008 to 2000 in effort to standard test date values 2008-07-22 18:57:45 +10:00
Adam Meehan
5885290304 added back Rails 2.1 check for time zone conversion attribute in define_attributes_methods and check for Rails 2.0 to return true if Time class column 2008-07-22 12:59:37 +10:00
Adam Meehan
b6187b5b50 made benchmark fairer for time comparison to ensure valid time must date as well 2008-07-22 12:18:57 +10:00
Adam Meehan
2464540264 Merge branch 'date_convert' 2008-07-22 11:51:04 +10:00
Adam Meehan
28b44b4ca6 some docs tweaks and spec value changes 2008-07-22 11:47:17 +10:00
Adam Meehan
727f3dc8e3 added make_time method to do time object creation with correct timezone handling for Rails 2.1 and 2.0 2008-07-22 11:45:33 +10:00
Adam Meehan
8082b5ce1c added specs for checking call to parse method to verify read and write attribute methods are defined 2008-07-22 11:39:17 +10:00
Adam Meehan
a674089c00 return Date object for date type timeliness_date_time_parse method 2008-07-22 10:13:52 +10:00
Adam Meehan
175b5c8d36 moved type cast conversion specs from attribute_methods to validations 2008-07-22 10:12:53 +10:00
Adam Meehan
800b187d08 added Date class define write method convert with parser
removed strict_time_type_cast method and use parse method directly
2008-07-22 10:11:27 +10:00
Adam Meehan
4d23756b47 updated extract method name to parse 2008-07-22 08:39:15 +10:00
Adam Meehan
89f12b3a25 renamed extract method to parse and updated specs 2008-07-22 08:34:14 +10:00
Adam Meehan
e8bba051c9 fixed spec with microseconds 2008-07-22 08:29:11 +10:00
Adam Meehan
3c9ad4a5ee added microseconds adjustment method and added proc_args 2008-07-21 16:50:08 +10:00
Adam Meehan
5e08a10fb0 renamed calls to timeliness_date_time_parse to parse_date_time which will correctly an overrided method 2008-07-21 13:48:25 +10:00
Adam Meehan
539f823b8b removed usless whitespace check in non-strict regexp match 2008-07-21 13:47:19 +10:00
Adam Meehan
4e8007bc65 added ignore_datetime_restriction_errors class option and docs
bit more for chronic parser
2008-07-21 13:02:21 +10:00
Adam Meehan
1836e4f6ca removed setting of time parts to 0 for date type in parse as any time parts should be valid as well
format proc now returns time array with nil values as 0
2008-07-21 10:31:06 +10:00
Adam Meehan
7a16d35e31 tweaked readme
changed mixed validation spec to datetime value out of Time range
2008-07-20 10:53:09 +10:00
Adam Meehan
80ed110efc tweaked doc examples and added message options 2008-07-20 09:38:04 +10:00
Adam Meehan
9cf994564e fixed fallback for out of range dates which Rails does not handle automatically
aliased timeliness_date_time_parse to parse_date_time for nicer interface
2008-07-20 09:06:39 +10:00
Adam Meehan
70ba75a4ae added switching to euro date formats instead of US 2008-07-20 08:38:34 +10:00
Adam Meehan
5f55fad076 added :before option to add_formats to insert above existing format 2008-07-20 07:45:22 +10:00
Adam Meehan
53d57cb7ac doc refinements 2008-07-19 21:52:37 +10:00
Adam Meehan
05abd4e984 minor line shifts 2008-07-19 19:49:15 +10:00
Adam Meehan
5983622ac8 moved extact_date_time_values method in to Formats and added specs
changed Formats to a class
2008-07-19 19:47:03 +10:00
Adam Meehan
137ee152e2 added changelog and license 2008-07-19 17:56:51 +10:00
Adam Meehan
1d2720ca67 added less than exhaustive datetime format validation specs 2008-07-19 17:25:01 +10:00
Adam Meehan
8ab82411ca added format add and remove methods
fixed slashes and 'd' token matching
specs for time and date format validation
2008-07-19 17:17:53 +10:00
Adam Meehan
ec46a3bd35 added specs for formats and more docs
renamed valid_time_formats etc to time_formats
2008-07-18 16:29:26 +10:00
Adam Meehan
e18d0ee9f4 moved tokens and proc arg map into class arrays 2008-07-18 11:27:32 +10:00
Adam Meehan
c9a3075c35 rewrote format regexp hash into time format to regexp generator 2008-07-18 08:05:21 +10:00
Adam Meehan
33c298163e moved format proc helper methods into formats module so they work 2008-07-17 16:25:54 +10:00
Adam Meehan
c37c3e82fa moved formats to own module 2008-07-17 15:08:33 +10:00
Adam Meehan
69ed88a086 moved formats to root module and retrieve from there in validations
added benchmarks for alternates
2008-07-17 15:00:18 +10:00
Adam Meehan
0dcc255901 changed parsing to use hash of regexp with optional processor blocks. Allows easy addition and removal of preffered formats 2008-07-17 14:29:59 +10:00
Adam Meehan
7cf8f2cbbc refactor parse to just a little simpler and a little more docs and cleanup 2008-07-17 06:43:03 +10:00