You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not use Time.new without zone. Use one of Time.zone.local, Time.current, Time.new.in_time_zone, Time.new.utc, Time.new.getlocal, Time.new.iso8601, Time.new.jisx0301, Time.new.rfc3339, Time.new.to_i, Time.new.to_f instead.
on this code:
def make_calendar_hash(date)
Range.new(1, Time.days_in_month(date.month, date.year)).map do |day| # <-- Here
{
date: Time.zone.local(date.year, date.month, day),
events: []
}
end
end
Strangely, it goes away when I move the method out of Range.new:
def make_calendar_hash(date)
days_in_month = Time.days_in_month(date.month, date.year)
Range.new(1, days_in_month).map do |day|
{
date: Time.zone.local(date.year, date.month, day),
events: []
}
end
end
days_in_month is a class method that only exists on Time as far as I can tell, although I think it has more to do with it being inside another method call than being a false positive unto itself.
I'm getting the following false positive:
on this code:
Strangely, it goes away when I move the method out of
Range.new
:days_in_month
is a class method that only exists onTime
as far as I can tell, although I think it has more to do with it being inside another method call than being a false positive unto itself.I tested with both the published version (0.42.0) and built from master at 19b7035
The text was updated successfully, but these errors were encountered: