tweaked readme

changed mixed validation spec to datetime value out of Time range
This commit is contained in:
Adam Meehan
2008-07-20 10:53:09 +10:00
parent 80ed110efc
commit 7a16d35e31
3 changed files with 26 additions and 27 deletions

View File

@@ -24,9 +24,6 @@ module ValidatesTimeliness
# Chronic. Just return nil for an invalid value and a Time object for a
# valid parsed value.
#
# Remember to attempt fallback to back to a DateTime if the Time object is
# out of range. Range for Ruby Time class on 32-bit *nix is down to about
# 1902-01-01 and 1970-01-01 for Windows.
def timeliness_date_time_parse(raw_value, type, strict=true)
return raw_value.to_time if raw_value.acts_like?(:time) || raw_value.is_a?(Date)