instance method
normalize_distance_of_time_argument_to_time
Ruby on Rails 7.1.6
Since v5.2.8.1 PrivateSignature
normalize_distance_of_time_argument_to_time(value)
No documentation comment.
Parameters
-
valuereq
Source
# File actionview/lib/action_view/helpers/date_helper.rb, line 706
def normalize_distance_of_time_argument_to_time(value)
if value.is_a?(Numeric)
Time.at(value)
elsif value.respond_to?(:to_time)
value.to_time
else
raise ArgumentError, "#{value.inspect} can't be converted to a Time value"
end
end
Defined in actionview/lib/action_view/helpers/date_helper.rb line 706
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::DateHelper