class Faker::Date

def between(from:, to:)

Other tags:
    Example: if used with Rails (Active Support) -
    Example: if used with or without Rails (Active Support) -

Returns:
  • (Date) -

Parameters:
  • to (Date, String) -- The end of the usable date range.
  • from (Date, String) -- The start of the usable date range.
def between(from:, to:)
  from = get_date_object(from)
  to   = get_date_object(to)
  Faker::Base.rand_in_range(from, to)
end