mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
Return date if date type
This commit is contained in:
parent
0f782a4ed5
commit
ad43eb31d6
@ -74,8 +74,10 @@ module ValidatesTimeliness
|
|||||||
@timeliness_cache[attr_name] = value
|
@timeliness_cache[attr_name] = value
|
||||||
|
|
||||||
if ValidatesTimeliness.use_plugin_parser
|
if ValidatesTimeliness.use_plugin_parser
|
||||||
|
type = self.class.timeliness_attribute_type(attr_name)
|
||||||
timezone = :current if self.class.timeliness_attribute_timezone_aware?(attr_name)
|
timezone = :current if self.class.timeliness_attribute_timezone_aware?(attr_name)
|
||||||
value = Timeliness::Parser.parse(value, self.class.timeliness_attribute_type(attr_name), :zone => timezone)
|
value = Timeliness::Parser.parse(value, type, :zone => timezone)
|
||||||
|
value = value.to_date if value && type == :date
|
||||||
end
|
end
|
||||||
|
|
||||||
@attributes[attr_name] = value
|
@attributes[attr_name] = value
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user