class Faker::Date

def between(legacy_from = NOT_GIVEN, legacy_to = NOT_GIVEN, from:, to:)

Returns:
  • (Date) -

Parameters:
  • to (Date) -- The end of the usable date range.
  • from (Date) -- The start of the usable date range.
def between(legacy_from = NOT_GIVEN, legacy_to = NOT_GIVEN, from:, to:)
  warn_for_deprecated_arguments do |keywords|
    keywords << :from if legacy_from != NOT_GIVEN
    keywords << :to if legacy_to != NOT_GIVEN
  end
  from = get_date_object(from)
  to   = get_date_object(to)
  Faker::Base.rand_in_range(from, to)
end