lib/validates_timeliness/converter.rb in validates_timeliness-5.0.1 vs lib/validates_timeliness/converter.rb in validates_timeliness-6.0.0.alpha1
- old
+ new
@@ -17,16 +17,15 @@
when :time
dummy_time(value)
when :date
value.to_date
when :datetime
- value.is_a?(Time) ? value : (time_zone_aware? ? value.in_time_zone : value.to_time)
+ value.is_a?(Time) ? value : value.to_time
else
value
end
-
if ignore_usec && value.is_a?(Time)
- value.change(usec: 0)
+ Timeliness::Parser.make_time(Array(value).reverse[4..9], (:current if time_zone_aware?))
else
value
end
end