lib/ffaker/time.rb in ffaker-1.16.0 vs lib/ffaker/time.rb in ffaker-1.16.1
- old
+ new
@@ -8,21 +8,21 @@
end
def date(params={})
years_back = params[:year_range] || 5
latest_year = params [:year_latest] || 0
- year = (rand * (years_back)).ceil + (Object::Time.now.year - latest_year - years_back)
+ year = (rand * (years_back)).ceil + (::Time.now.year - latest_year - years_back)
month = (rand * 12).ceil
day = (rand * 31).ceil
- series = [date = Object::Time.local(year, month, day)]
+ series = [date = ::Time.local(year, month, day)]
if params[:series]
params[:series].each do |some_time_after|
series << series.last + (rand * some_time_after).ceil
end
return series
end
- date
+ date.strftime "%Y-%m-%d %T %z"
end
MONTHS = k %w(January February March April May June July August September October November December)
end
-end
\ No newline at end of file
+end