schedules 2.0.0
schedules: ^2.0.0 copied to clipboard
A powerful and flexible Dart package for managing recurring events.
2.0.0 #
As well as the breaking changes below, I should have bumped to 2.0.0 when I added the MonthlyWeekday schedule, as this broke any exhaustive pattern matching. My apologies.
Breaking changes:
- Rename
TimeOfDaytoClockTimeto help avoid collisions with Material'sTimeOfDay. - The internal
DateTimehelper extensions are no longer exported frompackage:schedules/schedules.dart; onlytoClockTimeandwithClockTimeremain public. Timed.clockTimesis now aList<ClockTime>(an unmodifiable copy of the values passed in).Weekly.weekdaysandMonthly.daysare now unmodifiable copies of the lists passed to the constructors.
Bug fixes:
Singular.timedoccurrences now include the scheduled clock time instead of midnight.Singular.getOccurrencesUntilnow checks theendandexcludebounds against the occurrence instead of thefromdate.Singular.getNextNOccurrencesreturns an empty iterable whenn < 1.Daily.getOccurrencesUntilno longer yields occurrences before the schedule's start date whenfromis earlier thanstartDate.Weekly.getNextNOccurrencesyields occurrences in chronological order (and no longer drops occurrences) whenweekdaysis not sorted.Yearlygenerators no longer yield occurrences earlier than thefromdate or the schedule's start date.Yearlyschedules starting on February 29 now skip non-leap century years (e.g. 2100) instead of drifting to February 28.- The deprecated
findNextNOccurrencesandfindNextTillDateOccurrencesmethods now delegate to the iterable-based generators and can no longer loop forever when a schedule cannot produce the requested occurrences. For timed schedules they now return timed occurrences. ClockTime.hashCodeno longer collides for permuted field values, andClockTimenow has a usefultoString.
1.3.0 #
- Add support for timed events
- Add a new
TimeOfDayclass - Add a new
occursAt(TimeOfDay)method on all schedules - All schedules have a new
.timedconstructor that takes one or moreTimeOfDayobjects - List generation methods take times of day into account, when appropriate
- Add a new
1.2.0 #
- Add a new
MonthlyWeekdayschedule to represent events that occur on the _n_th weekday every x months.
1.1.0 #
- Add new versions of list-generating methods using math-based Iterable generators for improved performance
- Mark previous brute-force list-generating methods deprecated
1.0.0 #
- Begin stable build versioning
- Add two new methods for generating lists of dates that occur on a given schedule (thank you @v.paragallo.ict)
0.0.5 #
- Fix bugs in the date comparisons by properly ignoring the time component
- Add a
daysApartFromextension to clean up thedifferencecalculation
0.0.4 #
- Revise description for simplicity
0.0.3 #
- Add a release workflow file
- Add test and analyze workflow for CI
- Add an example
- Improve description
0.0.2 #
- Fix typos and grammar in README
0.0.1 Initial Version (2023-10-08) #
- Schedule sealed base class with subclasses for different schedule types:
- Singular: A single occurrence
- Daily: Repeats every n days
- Weekly: Repeats every n weeks on the given weekdays (Su - Sa)
- Monthly: Repeats every n months on the given day(s) of the month
- Yearly: Repeats every n years on the specified date
- Optional
endDateparameter to constrain the schedule