due_date 2.3.0
due_date: ^2.3.0 copied to clipboard
A package for working with repeating DateTime patterns (like the same day every month).
CHANGELOG #
2.3.0 - 2025.07.16 #
API Changes - Return values upgraded to more specific type #
Weekday.validator
: The return type of thevalidator
getter on theWeekday
enum has been narrowed from the generalDateValidator
to 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 thedueDateTime
getter on theClampInMonth
extension has been changed fromDueDateTime<Every>
toDueDateTime<EveryDueDayMonth>
. This provides a more accurate type for the created object.DueDateTime.next
: The return type of thenext
getter on theDueDateTime
class has been changed fromDueDateTime<Every>
toDueDateTime<T>
.DueDateTime.previous
: The return type of theprevious
getter on theDueDateTime
class 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
Period
class 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 optionalutc
boolean parameter tocopyWith
to 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
inexact
field. - Now implements the new
ExactDateValidator
interface.
- Added an
-
EveryDayInYear
:- Added an
inexact
field. - Now implements
ExactDateValidator
and the newExactEvery
interface.
- Added an
-
EveryDueDayMonth
&EveryDueWorkdayMonth
: Now implement the newExactEvery
interface.
Internal:
WorkdayHelper
: Now exposes adateValidator
field.ObjectExt
: Added new utility methodswhen2
andwhenn
.- Added new interface
_When
, and a helper functionboolCompareTo
for internal use.
Dependencies #
- Updated
equatable
from^2.0.0
to^2.0.3
. This should fix analysis issues withpub downgrade
.
2.2.2 - 2024.11.27 #
- Loosened the constraints of the dependencies.
2.2.1 - 2024.11.19 #
- Thightened the constraints of the dependencies.
2.2.0 - 2024.11.19 #
- Added [EveryDueTimeOfDay] and [EveryDueWorkdayMonth] and their respective implementations for [DateValidator].
2.0.0 - 2023.03.28 #
- Added [DateValidator] and some implementations.
- Implemented [DateValidator] in all implementations of [Every].
- Created [Period] and some implementations.
- Created [PeriodGeneratorMixin] and some implementations.
Breaking changes #
- API changes to always use optional named parameters.
- API changes replacing optional positional parameters for optional named parameters.
1.0.4 - 2022.08.23 #
- Fixed typo on changelog.
- Updated dependency
time
to fix issues.
1.0.3 - 2022.08.23 #
- Fixed repository and issues pointing to wrong package.
- Fixed example README.
1.0.2 - 2022.08.23 #
- Renamed
isWorkDay
->isWorkday
. Since is the same day of release, I won't consider this a breaking change.
1.0.1 - 2022.08.23 #
- Fixed Dart Conventions, added more description to the
pubspec.yaml
.
1.0.0 - 2022.08.23 #
- Initial stable release.