Active Date Range Versions Save

Powerful DateRanges for Ruby and ActiveSupport

v0.3.2

8 months ago

What's Changed

Full Changelog: https://github.com/moneybird/active-date-range/compare/v0.3.0...v0.3.2

v0.3.0

2 years ago
  • 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

v0.2.0

3 years ago

Adds support for weeks:

  • Shorthands for this_week, next_week and prev_week
  • full_week? and one_week?
  • next and previous now handle weeks correctly
  • Tests for biweekly calculations

v0.1.0

3 years ago

Initial 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.