-
Add current? to check if the period containts the current date.
Edwin Vlieg
-
Add .from_date_and_duration:
DateRange.from_date_and_duration(Date.new(2023, 1, 1), :month) # => Range
Edwin Vlieg
-
Add this_month?, this_quarter? and this_year? to check if a period is the current month, quarter or year
Edwin Vlieg
-
Fix issue with
next
not returning a full year when leap years are in the rangeEdwin Vlieg
-
include?
now behaves likecover?
for better performanceEdwin 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
-
Add support for weeks:
- Shorthands for
this_week
,next_week
andprev_week
full_week?
andone_week?
next
andprevious
now handle weeks correctly- Tests for biweekly calculations
Edwin Vlieg
- Shorthands for
-
Initial import of the DateRange implementation from the internal implementation in the Moneybird code.
Edwin Vlieg