Releases: FMorschel/due_date
Release v3.0.0
Released on 2026.02.06.
Breaking Changes
-
Removed interfaces:
ExactEvery,ExactTimeOfDay,EveryOverrideWrapper,EveryModifierInvalidator, andEverySkipInvalidModifierhave been removed. Use the new Adapter equivalents (EveryOverrideAdapter,EveryAdapterInvalidator,EverySkipInvalidAdapter) instead.EveryDateValidatorListMixinhas changed the signature.
-
validsInremoved: ThevalidsInmethod has been removed from all [DateValidator] and [EveryDateValidator] implementations. -
startDatenarrowed: ThestartDatemethod has been removed from [Every], [EveryMonth], [EveryYear], [EveryWeek], [LimitedEvery], and [EverySkipCountWrapper]. It now lives exclusively on [EveryDateValidator] and its subtypes. -
Weekday.occrurencesInremoved: Renamed tooccurrencesIn(typo fix). -
ExactEverysuper type removed from [EveryDayInYear], [EveryDueDayMonth], and [EveryDueWorkdayMonth]. -
EverySkipCountWrapperreparented: No longer extends [LimitedEvery] or mixes in [LimitedEveryModifierMixin]. Now extends [EveryWrapper] with [EveryWrapperMixin]. -
Constructor parameter renames:
validators→baseon [DateValidatorDifference], [DateValidatorIntersection], and [DateValidatorUnion].everyDateValidators→baseon [EveryDateValidatorUnion], [EveryDateValidatorDifference], and [EveryDateValidatorIntersection]. -
Entry point changes: Many classes previously exported from
period.dartare no longer available through that entry point (e.g. [Every], [EveryMonth], [EveryYear], [EveryWeek], [LimitedEvery], [WeekdayOccurrence], extensions, and modifier mixins). [PeriodGenerator] is no longer exported fromdue_date.dart.
New Features & Improvements
-
DateValidator.operator -: Added unary negation operator (-) to all [DateValidator] classes. Returns a [DateValidatorOpposite] that inverts validation. -
DateValidatorOpposite: A new [DateValidator] that negates the result of another validator. -
endDate: AddedendDatemethod to [EveryDateValidator] and all its implementations for reverse boundary resolution. -
Period.of: Added a new factory constructor on [Period]. -
New Adapter layer: Introduced a full set of adapter classes for wrapping [Every] / [LimitedEvery] instances with custom behavior:
- [EveryAdapter], [EveryAdapterMixin], [LimitedEveryAdapter], [LimitedEveryAdapterMixin].
- [EveryAdapterInvalidator], [EveryAdapterInvalidatorMixin], [LimitedEveryAdapterInvalidator].
- [EveryOverrideAdapter], [LimitedEveryOverrideAdapter].
- [EverySkipInvalidAdapter], [LimitedEverySkipInvalidAdapter].
- [EverySkipCountAdapter], [LimitedEverySkipCountAdapter].
- [EveryTimeOfDayAdapter], [LimitedEveryTimeOfDayAdapter].
-
New Modifier interfaces:
- [EverySkipCountModifier], [LimitedEverySkipCountModifier].
- [EveryTimeOfDayModifier], [LimitedEveryTimeOfDayModifier].
- [LimitedEveryModifier].
-
New Wrapper interfaces:
- [EveryWrapper], [EveryWrapperMixin], [LimitedEveryWrapper], [LimitedEveryWrapperMixin].
- [EveryTimeOfDayWrapper], [LimitedEveryTimeOfDayWrapper].
- [LimitedEverySkipCountWrapper].
-
New DateValidator / EveryDateValidator mixins and interfaces:
- [EveryDateValidatorMixin], [LimitedEveryDateValidatorMixin], [EveryDateValidatorListMixin].
- [LimitedEveryDateValidatorListMixin], [LimitedEveryDateValidator], [LimitedEveryMixin].
-
EveryModifier&EveryModifierMixin: Now implement [EveryDateValidator] (previously only [Every]). Addedvalid,invalid, andfilterValidDatesmethods. -
LimitedEveryModifierMixin: Now implements [LimitedEveryDateValidator] and [LimitedEveryModifier]. AddedthrowIfLimitReached,valid,invalid, andfilterValidDatesmethods. -
throwIfLimitReached: Added to [LimitedEvery], [EveryDateValidatorUnion], [EveryDateValidatorDifference], and [EveryDateValidatorIntersection]. -
EveryDueTimeOfDay: AddedmidnightandlastMicrosecondfields. -
DateDirection: Addedend,isEnd,isForward,isBackward, andcouldStayEqualfields. -
LimitedOrEveryHandler: AddedstartDateAdapter,endDate, andendDateAdaptermethods. -
Period Bundles: Added [TrimesterPeriodBundle] and [SemesterPeriodBundle].
Dependencies
- Updated
timefrom^2.1.5to^2.1.6.
Release v2.3.0
API Changes - Return values upgraded to more specific type
Weekday.validator: The return type of thevalidatorgetter on theWeekdayenum has been narrowed from the generalDateValidatorto the more specificDateValidatorWeekday. This improves type safety but may require casting in existing code if you were relying on the broader type.ClampInMonth.dueDateTime: The return type of thedueDateTimegetter on theClampInMonthextension has been changed fromDueDateTime<Every>toDueDateTime<EveryDueDayMonth>. This provides a more accurate type for the created object.DueDateTime.next: The return type of thenextgetter on theDueDateTimeclass has been changed fromDueDateTime<Every>toDueDateTime<T>.DueDateTime.previous: The return type of thepreviousgetter on theDueDateTimeclass has been changed fromDueDateTime<Every>toDueDateTime<T>.
New Features & Improvements
-
Period Bundles: Added new abstract base classes for period grouping:
SemesterPeriodBundle: A base class that represents a bundle of semesters, extendingTrimesterPeriodBundle.TrimesterPeriodBundle: A base class that represents a bundle of trimesters, extendingMonthPeriodBundle.
-
Timezone on Periods: The
Periodclass and all its subclasses (e.g.,WeekPeriod,DayPeriod,MonthPeriod, etc) now includeisUtc,isLocal,toUtc(), andtoLocal()for better timezone awareness and conversion. -
DueDateTime.copyWith: Added an optionalutcboolean parameter tocopyWithto allow for easy conversion to/from UTC when copying an instance. This will keep the exact timings and not convert the date. -
DateValidatorDayInYear:- Added an
inexactfield. - Now implements the new
ExactDateValidatorinterface.
- Added an
-
EveryDayInYear:- Added an
inexactfield. - Now implements
ExactDateValidatorand the newExactEveryinterface.
- Added an
-
EveryDueDayMonth&EveryDueWorkdayMonth: Now implement the newExactEveryinterface.
Internal:
WorkdayHelper: Now exposes adateValidatorfield.ObjectExt: Added new utility methodswhen2andwhenn.- Added new interface
_When, and a helper functionboolCompareTofor internal use.
Dependencies
- Updated
equatablefrom^2.0.0to^2.0.3. This should fix analysis issues withpub downgrade.