diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ef4d9a..cd6fdbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.1.1 [unreleased] + +- Fixed `current: false` +- Fixed `last` with `group_by_quarter` + ## 3.1.0 - Better support for date columns with `time_zone: false` diff --git a/lib/groupdate/magic.rb b/lib/groupdate/magic.rb index 44102f1..3dbbabe 100644 --- a/lib/groupdate/magic.rb +++ b/lib/groupdate/magic.rb @@ -189,13 +189,18 @@ module Groupdate end if step now = Time.now - now -= step if options[:current] == false # 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 + + time_range = + if options[:current] == false + round_time(start_at - step)...round_time(now) + else + round_time(start_at)..now + end end end time_range -- libgit2 0.21.0