Powerful DateRanges for Ruby and ActiveSupport
Full Changelog: https://github.com/moneybird/active-date-range/compare/v0.3.0...v0.3.2
include?
now behaves like cover?
for better performance
Edwin Vlieg
Add intersection support:
date_range.intersection(other_date_range) # => DateRange
Edwin Vlieg
Add support for boundless ranges:
date_range = DateRange.parse('202101..')
date_range.boundless? # => true
date_range.in_groups_of(:month) # => Enumerator::Lazy
Model.where(date: date_range) # => SQL "WHERE date >= 2021-01-01"
Edwin Vlieg
Add ActiveModel type for date range:
attribute :period, :date_range
Edwin Vlieg
Adds support for weeks:
this_week
, next_week
and prev_week
full_week?
and one_week?
next
and previous
now handle weeks correctlyInitial release of the ActiveDateRange gem. Contains an import of the value object from the internal implementation at Moneybird. We've been using this implementation in production for many years, therefore this release is not marked as a pre-release.