Skip to content

Commit

Permalink
Loop instead of multiply to change start_at - #151
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 26, 2016
1 parent 5479431 commit 080fab8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/groupdate/magic.rb
Expand Up @@ -190,7 +190,12 @@ def time_range
if step
now = Time.now
now -= step if options[:current] == false
time_range = round_time(now - (options[:last].to_i - 1) * step)..now
# loop instead of multiply to change start_at - see #151
start_at = now
(options[:last].to_i - 1).times do
start_at -= step
end
time_range = round_time(start_at)..now
end
end
time_range
Expand Down

0 comments on commit 080fab8

Please sign in to comment.