All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- impl From for MultiSchedule
- Added methods
ScheduleIter::assume_offset
,ScheduleIter::use_local_offset
and pendants forMultiScheduleIter
that allow to change the default offset (local) that dates are computed in to another.
- Introduced new WeekdayModifier variant "Last" to select the last occurrence of some weekday, e.g. "at 6 PM (last Monday)".
- Added
MultiSchedule
to accomodate a combination of several distinctSchedule
s. - Added
cron_lingo::error::Error::UnexpectedEndOfInput
. - Added
cron_lingo::error::Error::Syntax
andcron_lingo::error::SyntaxError
.
- Renamed
cron_lingo::error::InvalidExpression
to simplycron_lingo::error::Error
. - Expressions must now be parsed separately using
from_str
but may then be combined together withstd::ops::Add
or added to an existingMultiSchedule
usingstd::ops::AddAssign
. - Iterator of
Schedule
orMultiSchedule
is now fallible (next()
returnsOption<Result<time::OffsetDateTime, cron_lingo::error::Error>
) as the retrieval of the local offset may fail. - Creation of said iterators via
Schedule::iter()
orMultiSchedule::iter()
is now fallible as well for the same reason. - Moved from time v0.2.22 to v0.3. Compile flag is needed in order to avoid runtime errors when the local offset is retrieved internally:
RUSTFLAGS="--cfg unsound_local_offset" cargo build
. The compile flag may be omitted when your application is single-threaded.
- Removed variants
DuplicateInput
andIllogicalWeekdayCombination
from error enum as the occurrence of duplicates et al. does not prevent correct computation of the next upcoming date.
- Check for illogical combinations of weekdays and modifiers, e.g. "on Tuesdays and the 3rd Tuesday"
- Updated module description for more clarity regarding expression syntax
- Add
skip_outdated()
method to ScheduleIter to override default behaviour innext()
. By defaultnext()
will never return a date that is in the past, but instead resume the iteration from the current local time.
- Rename Timetable to Schedule
- Complete expression syntax overhaul to offer more possibilities
- Remove explicit lifetime from TimetableIter in order to use it with pyo3
- Fixed readme to reflect latest changes ...
Timetable
does not implementIterator
anymore. Instead.iter()
returns a wrapper structTimetableIter
that keeps track of state during iteration.- Removed function
new()
.