instance method normalize_distance_of_time_argument_to_time

Ruby on Rails 7.1.6

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

normalize_distance_of_time_argument_to_time(value)

No documentation comment.

Parameters

value req
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

Type at least 2 characters to search.

↑↓ navigate · open · esc close