lib/ffaker/time.rb in ffaker-2.20.0 vs lib/ffaker/time.rb in ffaker-2.21.0
- old
+ new
@@ -20,10 +20,10 @@
fetch_sample(DAYS_OF_WEEK)[0..(options[:long] ? 10 : 2)]
end
def datetime(params = {})
years_back = params[:year_range] || 5
- latest_year = params [:year_latest] || 0
+ latest_year = params[:year_latest] || 0
year = (rand * years_back).ceil + (::DateTime.now.year - latest_year - years_back)
month = rand(1..12)
day = rand(1..Date.new(year, month, -1).day)
hours = params[:hours] || rand(0..23)
minutes = params[:minutes] || rand(0..59)